%% Spectrogram of Chirp Signal
% This example shows the spectrogram for a chirp signal with added random noise.

Fs = 233e3;
frameSize = 20e3;
chirp = dsp.Chirp('SampleRate',Fs,...
  'SamplesPerFrame',frameSize,...
  'InitialFrequency',11e3,...
  'TargetFrequency',11e3+55e3);

scope = dsp.SpectrumAnalyzer('SampleRate',Fs);
scope.ViewType = 'Spectrogram';
scope.RBWSource = 'Property';
scope.RBW = 500;
scope.TimeSpanSource = 'Property';
scope.TimeSpan = 2;
scope.PlotAsTwoSidedSpectrum = false;

for idx = 1:50
  y = chirp()+ 0.05*randn(frameSize,1);  
  scope(y);
end

release(scope)