Why does Matlab spectrogram look stripy when windowed input is zero-padded? 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 &quot;winsize&quot; 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!
Since I don't have your original data, I'm going to give the answer from my intuition. Try Hann window function and 50% overlap and see what happens.
I have tried a human voice signal as input and whether zero-padding is applied doesn't change the results.
% signal = ...
winsize = 512;
win = hann(winsize, 'periodic'); % use hann window instead of rectangular window
shift = winsize/2; % 50% overlap 
nfft = winsize;
% nfft=round(1.5*winsize);
srate = 48e3;
figure;
spectrogram(signal, win, winsize-shift, nfft, srate, 'yaxis');

Here are the results:

Forgive me for the Chinese xlabel and ylabel, they are respectively &quot;Time (s)&quot; and &quot;Frequency (kHz)&quot;, and the colorbar label stands for &quot;Power/Frequency (dB/Hz)&quot;. I don't see any visible difference between the two figures.
In addition, you can use a smaller FFT size. Generally, using such a long FFT size means that you need an extremely high frequency resolution.
$$
\Delta f = \frac{f_s}{\mathrm{NFFT}}
$$
where $\Delta f$ is the frequency resolution, which is 0.0168 Hz when $f_s$ = 78 Hz and NFFT = 4639. While a super high frequency resolution means a super low time resulution with the fact that $\Delta T = 1/ \Delta f$. In your case you only have 10 time sample results.

For the second question, 0 Hz means the direct current (DC) component. Maybe you should add some information about what kind of signal are you analysing.