12.07.2015 Views

Basics of MATLAB and Beyond

Basics of MATLAB and Beyond

Basics of MATLAB and Beyond

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Exercise 6 (Page 59)You can generate a sinusoidal frequency variation by specifying a sinusoidinput to the voltage controlled oscillator function vco. Get the results <strong>of</strong>specgram by using output arguments <strong>and</strong> compare a plot <strong>of</strong> the resultsusing an image <strong>and</strong> a surface plot:Fs = 1000;t = linspace(0,2*pi,8192);x = sin(t);y = vco(x,[0 500],Fs);[z,freq,time] = specgram(y,[],Fs);p = 20*log10(abs(z))subplot(221)imagesc(time,freq,p)axis xycolormap(flipud(gray))colorbarxlabel(’Time, sec’)ylabel(’Frequency, Hz’)subplot(223)surfl(time,freq,p)shading flatxlabel(’Time, sec’)ylabel(’Frequency, Hz’)zlabel(’Power, dB’)c○ 2000 by CRC Press LLC

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!