More about Sampling: Difference between revisions

From Class Wiki
Jump to navigation Jump to search
 
Line 13: Line 13:
Script for Matlab:
Script for Matlab:
clear all;
clear all;

t=0:.01:1;
t=0:.01:1;

T=0.20;
T=0.20;

ts=0:T:1;
ts=0:T:1;

f1=2;
f1=2;

f2=1/0.125;
f2=1/0.125;

plot(t,cos(2*pi*f2*t),'b-',ts,cos(2*pi*f1*ts),'r*',t,cos(2*pi*f1*t),'y-');
plot(t,cos(2*pi*f2*t),'b-',ts,cos(2*pi*f1*ts),'r*',t,cos(2*pi*f1*t),'y-');

plot(ts,cos(2*pi*f1*ts),'r*',t,cos(2*pi*f1*t),'y-');
plot(ts,cos(2*pi*f1*ts),'r*',t,cos(2*pi*f1*t),'y-');

Latest revision as of 11:37, 12 November 2007

Aliasing

Aliasing is when different continuous signals become indistinguishable when sampled, this might happen when sampling too slow. It can also refer to the distortion that occurs when a signals are sampled and reconstructed as aliases of the original signals.

Here is an example of aliasing:

Signals 2hw-11.jpg Signals hw-11.jpg

Like we can see in this images, the samples that we are getting out of the yellow wave, can be also samples in the blue one.


Script for Matlab: clear all;

t=0:.01:1;

T=0.20;

ts=0:T:1;

f1=2;

f2=1/0.125;

plot(t,cos(2*pi*f2*t),'b-',ts,cos(2*pi*f1*ts),'r*',t,cos(2*pi*f1*t),'y-');

plot(ts,cos(2*pi*f1*ts),'r*',t,cos(2*pi*f1*t),'y-');