Spectrogram of Chirp Signal
Generate two seconds of a signal composed of a voltage-controlled oscillator (vco) and four Gaussian atoms. The instantaneous frequency is modulated by a chirp function. The sample rate is 14 kHz.
fs = 14000; t = (0:1/fs:2)'; gaussFun = @(A,x,mu,f) exp(-(x-mu).^2/(2*0.01^2)).*sin(2*pi*f.*x)*A'; s = gaussFun([1 1 1 1],t,[0.2 0.5 1 1.75],[10 60 25 5]*100)/10; x = vco(chirp(t+.1,0,t(end),3).*exp(-2*(t-1).^2),0.2*fs,fs); s = s/10+x;
Plot the spectrogram of the generated signal. Specify 90% overlap and moderate spectral leakage.
Spectrogram of Sawtooth Signal
Generate two seconds of a signal sampled at 10 kHz whose instantaneous frequency is a triangle function of time.
fs = 10000; t = 0:1/fs:2; x = vco(sawtooth(2*pi*t,0.75),[0.1 0.4]*fs,fs);
Plot the spectrogram of the generated signal. Specify the leakage as
0.80 and the overlap between adjoining segments as 95%.
x — Input data
real vector | real matrix
Input data, specified as a real vector or real matrix.
–1 corresponds to 0 frequency output,
0 corresponds to
1 corresponds to
fc — Carrier frequency
4 (default) | real positive scalar
Carrier or reference frequency used to modulate the input signal, specified as a real positive scalar.