| 
  • If you are citizen of an European Union member nation, you may not use this service unless you are at least 16 years old.

  • You already know Dokkio is an AI-powered assistant to organize & manage your digital files & messages. Very soon, Dokkio will support Outlook as well as One Drive. Check it out today!

View
 

EEN436 Project 2 Part 1

Page history last edited by Leon D\'Angio 15 years, 5 months ago

EEN436

Introduction to DSP

----------------------------

Project 2

Part 1 // Part 2 // Part 3 // Part 4

Observations and Conclusions

----------------------------

 

Description

     In this part, we begin by plotting a continuous version of a function, x(t), over its non-zero extent. In this case, x(t) is a monotonically decreasing exponential with exponent -1000*abs(t). We then calculate and observe its continuous-time Fourier transform (CTFT). We then sample the continuous signal at the Nyquist Rate, as well as a 1/4 of the Nyquist Rate. We observe the effects that this has when we take the discrete-time Fourier transform (DTFT) of these discrete signals. After this, we interpolate the discrete signals to represent something closer to the continuous signal and observe the difference between these versions and the original continuous signal.

 

Code, Results, and Plots

 Proj2_1.m

%Part A

t=(-5/1000):1/10000:(5/1000);

x=exp(-1000*abs(t));

plot(t, x); title('X(t) Over Non-Zero Extent'); grid on;

xlabel('Time, sec'); ylabel('Amplitude');

 

%%

%Part B

w=-2*pi*2000:pi:2*pi*2000;

ctftx=sqrt(2/pi)*1000./(1000^2+w.^2);

figure(2);

plot(w, abs(ctftx)); title('CTFT of X(t)'); grid on;

xlabel('Radial Frequency, w'); ylabel('Magnitude');

 

 

%%

%Part C 

BW=5000; %Hertz

fs=2*BW;

n=-(5/1000):1/fs:(5/1000);

w=0:2*pi*10000;

x=exp(-1000*abs(n));

 

figure(3);

stem(n, x); title('x[n]');grid on;

xlabel('Samples'); ylabel('Amplitude');

 

fftx=fft(x, length(w)); 

figure(4);

plot(abs(fftx)); axis([0 5000*pi 0 20]);

title('DTFT of x[n] from 0~pi');

xlabel('Rad/sec'); ylabel('Magnitude');

 

 

%%

%Part E

y=ideal_interpolator(x, 5);

for i=1:length(y)

    y1(i)=y((length(y)+1)-i);

end;

y=[y y1];

 

figure(5);

plot(y); title('Interpolated Version of x[n]');

 

 

%%

%Part D

fs=.25*fs;

n=-(5/1000):1/fs:(5/1000);

x=exp(-1000*abs(n));

 

figure(6);

stem(n,x); title('Undersampled x[n]');

xlabel('Samples'); ylabel('Amplitude');

fftx=fft(x, length(w));

 

 

figure(7);

plot(abs(fftx)); axis([0 5000*pi 0 20]);

title('DTFT of Undersampled x[n] from 0~pi');

xlabel('Rad/sec'); ylabel('Magnitude')

 

%%

%Part F

y=ideal_interpolator(x, 10);

for i=1:length(y)

    y1(i)=y((length(y)+1)-i);

end;

y=[y y1];

 

figure(8);

plot(y); title('Interpolated Version of Undersampled x[n]');

 

 

 

 

Comments (0)

You don't have permission to comment on this page.