question with chirped signal
I can't interpret numpy code, but I don't think you should define an 'N' variable. For a 2-second signal you should have a total of 16000 samples. Here's how to do this in MATLAB (notice how I defined my &quot;number of samples&quot; variable ('Num_Samples')):
Fs = 8000;
Ts = 1/Fs; % Time between samples
T1 = 2; % Signal duration = two seconds
F0 = 0; % Start frequency
F1 = 10; % Stop frequency (at T1 seconds)
Num_Samples = 2/Ts; % Two seconds divided by 'Ts'
n = 0:Num_Samples-1; % Here's your time-domain index
Alpha = (F1-F0)/T1;
X = cos(2*pi*F0*n*Ts + Alpha*pi*(n*Ts).^2);

figure(1)
plot(n*Ts, X, '-bs'), grid on

Finding the number of zero-crossings in the 2 second duration of your chirp signal is nothing more than examining each generated 'x(nTs)' sample (starting with the 2nd sample) and seeing if its polarity is different from the previous 'x((n-1)Ts)' sample. Each time a polarity difference occurs you have a single zero-crossing.