convert signals to spectrogram

11 views (last 30 days)
mr de
mr de on 13 Dec 2021
Hi, I want to convert the existing signals to spectrogram images automatically and save them in jpg format, so how do I change the following code to execute the code correctly?
Thank you!
clc
clear all
close all
Path = 'IS\*.mat';
Files = dir(Path);
for i=1:length(Files)
fn = [Path(1:end-5) Files(i,1).name];
load(fn);
y = val(1:3600);
[thr,sorh,keepapp] = ddencmp('den','wv',y);
sig1 =wdencmp('gbl',y,'sym10',10,thr,sorh,keepapp);
fs=128;
pspectrum(sig1,fs,'spectrogram','TimeResolution',0.5)
title('pspectrum Signal')
temp=[num2str(i,'%04d')];
saveas(temp,'jpg');
end

Answers (0)

Categories

Find more on Time-Frequency Analysis in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!