how to save spectrogram of signal as image ? i have given my code.
3 ビュー (過去 30 日間)
古いコメントを表示
arunnagiri murrugesan
2018 年 9 月 10 日
コメント済み: Mihir Pingle
2021 年 2 月 19 日
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!