how to save spectrogram of signal as image ? i have given my code.

11 vues (au cours des 30 derniers jours)
arunnagiri murrugesan
arunnagiri murrugesan le 10 Sep 2018
Commenté : Mihir Pingle le 19 Fév 2021
x=train_data(91,:,1); N = 1000; fs=250; t=(1:N)/fs; Fn=fs/2; Wp = [8 30]/Fn; % Passband Frequency (Normalised) Ws = [7.8 31]/Fn; % Stopband Frequency (Normalised) Rp = 1; % Passband Ripple (dB) Rs = 150; % Stopband Ripple (dB) [n,Ws] = cheb2ord(Wp,Ws,Rp,Rs); % Filter Order [z,p,k] = cheby2(n,Rs,Ws); % Filter Design [sosbp,gbp] = zp2sos(z,p,k); % Filter Signal filtered_signal = filtfilt(sosbp, gbp,x); Z1=filtered_signal; figure spectrogram(Z1,128,120,128,fs,'yaxis') title('SPECTROGRAM of MOTOR IMAGERY EEG SIGNAL CHANNEL C3')

Réponse acceptée

KALYAN ACHARJYA
KALYAN ACHARJYA le 10 Sep 2018
Modifié(e) : KALYAN ACHARJYA le 10 Sep 2018
x=train_data(91,:,1);
N=1000;
fs=250;
t=(1:N)/fs;
Fn=fs/2;
Wp=[8 30]/Fn; % Passband Frequency (Normalised)
Ws=[7.8 31]/Fn; %Stopband Frequency (Normalised)
Rp=1; % Passband Ripple (dB)
Rs=150; % Stopband Ripple (dB)
[n,Ws]=cheb2ord(Wp,Ws,Rp,Rs); % Filter Order
[z,p,k]=cheby2(n,Rs,Ws); % Filter Design
[sosbp,gbp]=zp2sos(z,p,k);
%Filter Signal
filtered_signal=filtfilt(sosbp, gbp,x);
Z1=filtered_signal;
figure spectrogram(Z1,128,120,128,fs,'yaxis')
title('SPECTROGRAM of MOTOR IMAGERY EEG SIGNAL CHANNEL C3');
saveas(gcf,'filename.png'); %Use to display save as image
  2 commentaires
Sylvain Boutros
Sylvain Boutros le 19 Mai 2020
Is there a way to saveas with specific size? I've got melspecs that are generated 656x875 and I was wondering how I could save them using saveas to about 256x256?
Mihir Pingle
Mihir Pingle le 19 Fév 2021
imwrite(imresize(im,[227,227]),filename)
use this command

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Time-Frequency Analysis dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by