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

9 visualizaciones (últimos 30 días)
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')

Respuesta aceptada

KALYAN ACHARJYA
KALYAN ACHARJYA el 10 de Sept. de 2018
Editada: KALYAN ACHARJYA el 10 de Sept. de 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 comentarios
Sylvain Boutros
Sylvain Boutros el 19 de Mayo de 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 el 19 de Feb. de 2021
imwrite(imresize(im,[227,227]),filename)
use this command

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Time-Frequency Analysis en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by