Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

2. The MATLAB program below generates and attempts to recover a sampled signal using the Fast Fourier Transform (fft) and Inverse Fast Fourier Transform (ifft)

image text in transcribed
image text in transcribed
2. The MATLAB program below generates and attempts to recover a sampled signal using the Fast Fourier Transform (fft) and Inverse Fast Fourier Transform (ifft) functions. This program will also be used in the Lab 1 exercises. % Recovery of Sampled Signal (Sine Wave) % Generate sampled signal N- input(Enter number of samples: ); xn = sin(2 * pi * n * Ts); subplot (3, 1, 1), stem(n, xn) % Digital frequency spectrum X-fft(xn); Xn- X(12:N]); subplot (3, 1,2), bar(abs(Xn/Xn(1) % Shift index % Reconstruct sampled signal x - ifft(X); subplot(3, 1, 3), plot(n, x) (over) Run this program for the following waveforms: (a) Square wave- one period with 16 samples (see stem plot of xn below) 0.5 F 5 10 15 (b) Sawtooth wave-one period with 16 samples (see stem plot of xn below) 0.5 F 5 10 15 Note: For the square and sawtooth waves, specify xn as a function of n and Ts (not as a sequence of numbers). For both waveforms, use the data cursor to measure the magnitudes of the harmonics. Then, repeat the runs with 32 samples, and compare the magnitudes to those for 16 samples. (c) AM waveform used in Problem 1, with 64 samples. (d) FM waveform used in Problem 1, with 64 samples. (e) Random noise- uniformly distributed x- rand(1,N) (n) Random noise -normally distributed x = randn( 1 ,N); For the random noise parts, choose an appropriate number of samples and comment on the resulting frequency spectra. Submit the resulting plots for each part, along with the appropriate analysis. Do not submit the given program- only show the changes

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions