Sine Waves. Notation s 0 … s n … s N or s(0), … s(n), … s(N) Sketch the following digital...

8
Sine Waves

Transcript of Sine Waves. Notation s 0 … s n … s N or s(0), … s(n), … s(N) Sketch the following digital...

Page 1: Sine Waves. Notation s 0 … s n … s N or s(0), … s(n), … s(N) Sketch the following digital signals: δ (n) = 1, n = 0 = 0, otherwise u (n) = 1, n >= 0 =

Sine Waves

Page 2: Sine Waves. Notation s 0 … s n … s N or s(0), … s(n), … s(N) Sketch the following digital signals: δ (n) = 1, n = 0 = 0, otherwise u (n) = 1, n >= 0 =

Notation

• s0… sn … sN or s(0), … s(n), … s(N)

• Sketch the following digital signals:• δ (n) = 1, n = 0

= 0, otherwise

• u (n) = 1, n >= 0

= 0, n < 0

• x (n) = an

– (for a = 1; 0<a<1; a>1, and a=-1; -1<a<0; a<-1)

Page 3: Sine Waves. Notation s 0 … s n … s N or s(0), … s(n), … s(N) Sketch the following digital signals: δ (n) = 1, n = 0 = 0, otherwise u (n) = 1, n >= 0 =

Sine Wave Generation

• Point P moves at f Hz (cycles/s) duration of 1cycle T = 1/f

• There are N samples in one rotation of the point P

• sn = r sin(n) , where n refers to the nth sample time

• We have:

ss

ns

nn

πfnTrF

πfnrsFNf

N

πnrs

N

n

π

θ

2sin2

sin

2sin

2

snT is simply an array of sample times

Page 4: Sine Waves. Notation s 0 … s n … s N or s(0), … s(n), … s(N) Sketch the following digital signals: δ (n) = 1, n = 0 = 0, otherwise u (n) = 1, n >= 0 =

Sine Wave Generation in MATLAB

function sig = makesine (f, fs, timelen)

t = 0:(1/fs):timelen-(1/fs);

sig = sin(2*pi*f*t);

plot (t, sig);

grid;

Page 5: Sine Waves. Notation s 0 … s n … s N or s(0), … s(n), … s(N) Sketch the following digital signals: δ (n) = 1, n = 0 = 0, otherwise u (n) = 1, n >= 0 =

Sampling when 2

sFf

Page 6: Sine Waves. Notation s 0 … s n … s N or s(0), … s(n), … s(N) Sketch the following digital signals: δ (n) = 1, n = 0 = 0, otherwise u (n) = 1, n >= 0 =

Phase

• π/2 rad (90°) phase shift in sampling

Page 7: Sine Waves. Notation s 0 … s n … s N or s(0), … s(n), … s(N) Sketch the following digital signals: δ (n) = 1, n = 0 = 0, otherwise u (n) = 1, n >= 0 =

Aliasing• What happens as we decrease the sampling rate?

Page 8: Sine Waves. Notation s 0 … s n … s N or s(0), … s(n), … s(N) Sketch the following digital signals: δ (n) = 1, n = 0 = 0, otherwise u (n) = 1, n >= 0 =

Conclusion

• We cannot recover signal components >Fs/2– Nyquist Theorem

• If analog signal has frequency components >Fs/2, they will cause distortion by appearing

as aliases– Must use anti-aliasing filter before sampling