PRACTICAL MATLAB® FOR ENGINEERS PRACTICAL MATLAB
530 Practical MATLAB® Applications for Engineers Example 5.10 Let the audio analog signal f(t) be given by ft tTs tTst Ts Ts t T ...
DTFT, DFT, ZT, and FFT 531 MATLAB Solution % Script file: shift N=256; fs = 8000;Ts =1/fs; shift =32; t = linspace(0,Ts*255,256) ...
532 Practical MATLAB® Applications for Engineers xlabel(‘frequency in Hz’) disp(‘*********************************************** ...
DTFT, DFT, ZT, and FFT 533 Time 0 500 1000 1500 2000 frequency in Hz Frequency 2500 3000 3500 4000 (^050010001500200025003000350 ...
534 Practical MATLAB® Applications for Engineers Observe that the magnitude spectrum for f(n) and f(n − 32) are similar. The pha ...
DTFT, DFT, ZT, and FFT 535 figure(2) corr = xcorr(f1n,f2n); N= length (corr); m = 0:1:N-1; subplot (3,1,1) stem(m,corr);title(‘C ...
536 Practical MATLAB® Applications for Engineers 1 0.5 0 0 5 10 15 Stair plot of f1(n) versus n 20 25 30 Amplitude−0.5 − 1 1 0.5 ...
DTFT, DFT, ZT, and FFT 537 − 15 − 40 − 30 − 20 − 10 0 10 20 30 40 − 10 − 5 0 Amplitude 5 10 15 20 Auto-correlation plots R11 R22 ...
538 Practical MATLAB® Applications for Engineers 20 30 time index n 100 40 50 60 70 0 0.5 1 1.5 − 10 − 10 100 20 30 40 50 60 70 ...
DTFT, DFT, ZT, and FFT 539 0 0 0.5 1 Amplitude1.5 2 2.5 3 3.5 0.1 0.2 0.3 0.4 0.5 0.6 time 0.7 0.8 0.9 1 [f(t)=3*exp(-5*t)] vers ...
540 Practical MATLAB® Applications for Engineers − 3 − 2 − 1 0 Phase 1 2 0 0.002 0.004 Magnitude 0.006 0.008 0.01 − 2 − 1 − 1 −0 ...
DTFT, DFT, ZT, and FFT 541 Example 5.13 The system difference equation of an LTI system is given by g(n) = 0.7g(n − 1) − 0.3g(n ...
542 Practical MATLAB® Applications for Engineers g. Estimate and plot (Figure 5.59) the magnitude and phase errors of the two me ...
DTFT, DFT, ZT, and FFT 543 title(‘[System output sequence g(n)] vs n, using filter’) xlabel(‘time index n’);ylabel(‘Magnitude’) ...
544 Practical MATLAB® Applications for Engineers 0 5 10 15 20 25 30 35 40 45 50 − 1 0 1 2 [System impulse response h(n)] versus ...
DTFT, DFT, ZT, and FFT 545 0 10 20 30 40 50 0 5 10 15 20 abs[fft(gf(n))] abs[fft(gf(n))] versus k 0 10 20 30 40 50 − 4 − 2 0 2 4 ...
546 Practical MATLAB® Applications for Engineers Example 5.14 Let the impulse response of an LTI system be given by hn n n (). ...
DTFT, DFT, ZT, and FFT 547 0 5 10 time index n 15 20 25 0 5 10 time index n 15 20 25 Amplitude − 1 0 1 2 Amplitude − 1 0 1 2 [ID ...
548 Practical MATLAB® Applications for Engineers Error = [part(b)-part(c) versus n 6 8 × 10 −^16 4 2 0 − 2 − 4 − 6 − 5 051015 20 ...
DTFT, DFT, ZT, and FFT 549 magH = abs(H);phaseH = angle(H); subplot (2,1,1); plot (W,magH);title (‘abs[H(exp(-jW))] vs W’);ylabe ...
«
23
24
25
26
27
28
29
30
31
32
»
Free download pdf