how to save spectrogram of signal as image ? i have given my code.
3 次查看(过去 30 天)
显示 更早的评论
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')
0 个评论
采纳的回答
KALYAN ACHARJYA
2018-9-10
编辑:KALYAN ACHARJYA
2018-9-10
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 个评论
Sylvain Boutros
2020-5-19
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?
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Time-Frequency Analysis 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!