Zero padding in spectrogram function

17 visualizaciones (últimos 30 días)
yossef cohen
yossef cohen el 10 de Ag. de 2019
Respondida: Galdir Reges el 31 de Jul. de 2020
Hi, i am kinda new with matlab. how do i use zeropadding to test if i get better results?
after i load the data of my experiments i use the following code:
window = 512 ;
figure(2);
spectrogram(data,blackman(window),500,window, fs ,'yaxis');
xlabel('Time (sec)');
ylabel('Frequency (Hz)');
colormap jet ;
thanks for help!
  1 comentario
dpb
dpb el 10 de Ag. de 2019
Paste 'em on the end of your input vector

Iniciar sesión para comentar.

Respuestas (1)

Galdir Reges
Galdir Reges el 31 de Jul. de 2020
If you want zero padding to increase the resolution of each short time fft, you must change the nfft in syntax
spectrogram(x,window,noverlap,nfft, fs)
If X is a vector and the length of X is less than nfft, then X is padded with trailing zeros to length nfft.(https://www.mathworks.com/help/matlab/ref/fft.html)
Also, you define can use the syntax with cyclical frequencies, specified as a vector. f must have at least two elements, because otherwise the function interprets it as nfft. The units of f are specified by the sample rate, fs.
spectrogram(x,window,noverlap,f, fs)
then f specify a frequency zoom and zero padding. For example, f=[55:0.001:65], with fs in samples per second, set the spectrogram to the range between 55Hz and 65Hz also with a frequency increment of 0.001 Hz using enough zero padding to that

Categorías

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

Community Treasure Hunt

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

Start Hunting!

Translated by