Zero padding in spectrogram function
14 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaire
Réponses (1)
Galdir Reges
le 31 Juil 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
0 commentaires
Voir également
Catégories
En savoir plus sur Time-Frequency Analysis dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!