I am working on a little project, and stumpled upon something I cannot understand yet. I am learning cognitive science, and don't have DSP knowledge background, only learning from what I find on the internet. I have got an 46380x1 double array, which contains my signal. I would like to draw a nice spectrogram out of it like this:
%%signal = %%too long to put here, 46380x1 double array
winsize = ceil(length(signal)/10); %% =4639
win = rectwin(winsize);
shift = ceil(length(signal)/150); %% =310
nfft = winsize;
srate = 78;
spectrogram(signal, win, winsize-shift, nfft, srate, 'yaxis');
ylim([0.015 2]);
It works fine, and shows this:
But if I would like to zero pad the windowed signal (Matlab docs say, increasing nfft will do that), the output gets these stripes in it, and no matter what factor I scale "winsize" by, It will always show some kind of distortion in the spectrogram. For example I set nfft=round(1.5*winsize)
before making the spectrogram, and the its output changed to this:
Why is this happening? I know I cannot increase the amount of information in the signal by zero padding, but it might be more readable to the human eye if not so pixelated, that's why I am trying to apply zero padding here. Can you please help, what I should try to achieve this without getting those lines?
Anyway, there is a huge magnitude output component of the spectrogram, throughout the whole time axis, at the very close-to-zero frequency, if I view the trajectory starting from 0hz. view(-135,65); ylim([0 2]);
Why is that?
Thanks in advance!