How to do aliasing study of a signal with matlab?
Show older comments
Hi, I'm new on this forum and I'm a beginner in matlab-using.
I was assigned to do this exercise for an university course...but I fear I'm not able to do it:
I have this signal:
u(t) = e^(-2t)*δ-1(t) (δ-1 is a heaviside step function)
I have to transform the signal with matlab function "Laplace", then to discretize (at different rate) it with Tustin, then to plot the Fourier Transform of the discretized signals to show how diffenent sampling rate produce different qualities of signal discretization.
Then I have to use a filter toreconstruct the signal.
I had tryed to write a .m file containing the istruction I found in the Help, but I always get some errors when I run it:
t=0:0.01:10;
syms t
f = exp(-2*t);
l=f*heaviside(0);
laplace (l)
F=laplace(l);
F = tf([1],[1 2]);
Fsamp = c2d(F, 0.1, 'tustin');
Fsamp2 = c2d(F, 0.2, 'tustin');
Fsamp5 = c2d(F, 0.5, 'tustin');
bode(Fsamp, Fsamp2, Fsamp5), grid
W=[-100:0.1:100];
Fou=freqresp(Fsamp,W);
fou=Fou(1,1,:);
fou=zeros(1,max(size(W)));
for i=1:max(size(W))
fou(i)=Fou(1,1,i);
end
fou1=fou.*0;
fou1=(1.500:1500)
plot(W,fou.*fou1)
What should I do? What is wrong in it?
I'll be very grateful to anyone who will help me.
Anna
1 Comment
Walter Roberson
on 18 Jun 2012
What errors do you see when you run the code?
Answers (0)
Categories
Find more on Butterworth in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!