Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Prof. Nizamettin AYDIN Advanced Digital Signal Processing.

Similar presentations


Presentation on theme: "1 Prof. Nizamettin AYDIN Advanced Digital Signal Processing."— Presentation transcript:

1 1 Prof. Nizamettin AYDIN naydin@yildiz.edu.tr http://www.yildiz.edu.tr/~naydin Advanced Digital Signal Processing

2 2 Sampling & Aliasing

3 3 LECTURE OBJECTIVES SAMPLING can cause ALIASING –Sampling Theorem –Sampling Rate > 2(Highest Frequency) Spectrum for digital signals, x[n] –Normalized Frequency ALIASING

4 4 SYSTEMS Process Signals PROCESSING GOALS: –Change x(t) into y(t) For example, more BASS –Improve x(t), e.g., image deblurring –Extract Information from x(t) SYSTEM x(t)y(t)

5 5 System IMPLEMENTATION DIGITAL/MICROPROCESSOR Convert x(t) to numbers stored in memory ELECTRONICS x(t)y(t) COMPUTERD-to-AA-to-D x(t)y(t)y[n]x[n] ANALOG/ELECTRONIC: Circuits: resistors, capacitors, op-amps

6 6 SAMPLING x(t) SAMPLING PROCESS Convert x(t) to numbers x[n] “n” is an integer; x[n] is a sequence of values Think of “n” as the storage address in memory UNIFORM SAMPLING at t = nT s IDEAL: x[n] = x(nT s ) C-to-D x(t)x[n]

7 7 SAMPLING RATE, f s SAMPLING RATE (f s ) – f s =1/T s NUMBER of SAMPLES PER SECOND – T s = 125 microsec  f s = 8000 samples/sec –UNITS ARE HERTZ: 8000 Hz UNIFORM SAMPLING at t = nT s = n/f s –IDEAL: x[n] = x(nT s )=x(n/f s ) C-to-D x(t) x[n]=x(nT s )

8 8

9 9 SAMPLING THEOREM HOW OFTEN ? –DEPENDS on FREQUENCY of SINUSOID –ANSWERED by SHANNON/NYQUIST Theorem –ALSO DEPENDS on “RECONSTRUCTION”

10 10 Reconstruction? Which One? Given the samples, draw a sinusoid through the values

11 11 STORING DIGITAL SOUND x[n] is a SAMPLED SINUSOID –A list of numbers stored in memory EXAMPLE: audio CD CD rate is 44,100 samples per second –16-bit samples –Stereo uses 2 channels Number of bytes for 1 minute is –2 × (16/8) × 60 × 44100 = 10.584 Mbytes

12 12 DISCRETE-TIME SINUSOID Change x(t) into x[n] DERIVATION DEFINE DIGITAL FREQUENCY

13 13 DIGITAL FREQUENCY VARIES from 0 to 2 , as f varies from 0 to the sampling frequency UNITS are radians, not rad/sec –DIGITAL FREQUENCY is NORMALIZED

14 14 SPECTRUM (DIGITAL) 2  –0.2 

15 15 SPECTRUM (DIGITAL) ??? 2  –2  ? x[n] is zero frequency???

16 16 The REST of the STORY Spectrum of x[n] has more than one line for each complex exponential –Called ALIASING –MANY SPECTRAL LINES SPECTRUM is PERIODIC with period = 2  –Because

17 17 ALIASING DERIVATION Other Frequencies give the same

18 18 ALIASING DERIVATION–2 Other Frequencies give the same

19 19 ALIASING CONCLUSIONS ADDING f s or 2f s or –f s to the FREQ of x(t) gives exactly the same x[n] –The samples, x[n] = x(n/ f s ) are EXACTLY THE SAME VALUES GIVEN x[n], WE CAN’T DISTINGUISH f o FROM (f o + f s ) or (f o + 2f s )

20 20 NORMALIZED FREQUENCY DIGITAL FREQUENCY

21 21 SPECTRUM for x[n] PLOT versus NORMALIZED FREQUENCY INCLUDE ALL SPECTRUM LINES –ALIASES ADD MULTIPLES of 2  SUBTRACT MULTIPLES of 2  –FOLDED ALIASES ALIASES of NEGATIVE FREQS

22 22 SPECTRUM (MORE LINES) 2  –0.2  1.8  –1.8 

23 23 SPECTRUM (ALIASING CASE) –0.5  –1.5  0.5  2.5  –2.5  1.5 

24 24 SPECTRUM (FOLDING CASE) 0.4  –0.4  1.6  –1.6 

25 25 ALIASING DERIVATION Other Frequencies give the same

26 26 ALIASING DERIVATION–2 Other Frequencies give the same

27 27 FOLDING DERIVATION Negative Freqs can give the same SAME DIGITAL SIGNAL

28 28 FOLDING (a type of ALIASING) MANY x(t) give IDENTICAL x[n] CAN’T TELL f o FROM (f s -f o ) –Or, (2f s -f o ) or, (3f s -f o ) EXAMPLE: –y(t) has 1000 Hz component –SAMPLING FREQ = 1500 Hz –WHAT is the “FOLDED” ALIAS ?

29 29 DIGITAL FREQ AGAIN FOLDED ALIAS ALIASING

30 30 FOLDING DIAGRAM

31 31 FOLDING DIAGRAM

32 32 ALIASING DERIVATION Other Frequencies give the same

33 33 D-to-A Conversion

34 34 A-to-D Convert x(t) to numbers stored in memory D-to-A Convert y[n] back to a “continuous-time” signal, y(t) y[n] is called a “discrete-time” signal SIGNAL TYPES COMPUTERD-to-AA-to-D x(t)y(t) y[n]x[n]

35 35 SAMPLING x(t) UNIFORM SAMPLING at t = nT s IDEAL: x[n] = x(nT s ) C-to-D x(t)x[n]

36 36 NYQUIST RATE “Nyquist Rate” Sampling – f s > TWICE the HIGHEST Frequency in x(t) –“Sampling above the Nyquist rate” BANDLIMITED SIGNALS –DEF: x(t) has a HIGHEST FREQUENCY COMPONENT in its SPECTRUM –NON-BANDLIMITED EXAMPLE TRIANGLE WAVE is NOT BANDLIMITED

37 37 SPECTRUM for x[n] INCLUDE ALL SPECTRUM LINES –ALIASES ADD INTEGER MULTIPLES of 2  and - 2  –FOLDED ALIASES ALIASES of NEGATIVE FREQS PLOT versus NORMALIZED FREQUENCY –i.e., DIVIDE f o by f s

38 38 EXAMPLE: SPECTRUM x[n] = Acos(0.2  n+  ) FREQS @ 0.2  and -0.2  ALIASES: –{2.2 , 4.2 , 6.2 , …} & {-1.8 ,-3.8 ,…} –EX: x[n] = Acos(4.2  n+  ) ALIASES of NEGATIVE FREQ: –{1.8 ,3.8 ,5.8 ,…} & {-2.2 , -4.2  …}

39 39 SPECTRUM (MORE LINES) 2  –0.2  1.8  –1.8 

40 40 SPECTRUM (ALIASING CASE) –0.5  –1.5  0.5  2.5  –2.5  1.5 

41 41 FOLDING (a type of ALIASING) EXAMPLE: 3 different x(t); same x[n] 900 Hz “folds” to 100 Hz when f s =1kHz

42 42 DIGITAL FREQ AGAIN FOLDED ALIAS ALIASING

43 43 SPECTRUM (FOLDING CASE) 0.4  –0.4  1.6  –1.6 

44 44 FREQUENCY DOMAINS D-to-AA-to-D x(t)y(t)x[n]y[n]

45 45 FOLDING DIAGRAM

46 46 D-to-A Reconstruction Create continuous y(t) from y[n] –IDEAL If you have formula for y[n] –Replace n in y[n] with f s t –y[n] = Acos(0.2  n+  ) with f s = 8000 Hz –y(t) = Acos(2  (800)t+  ) COMPUTER D-to-AA-to-D x(t)y(t)y[n]x[n]

47 47 D-to-A is AMBIGUOUS ! ALIASING –Given y[n], which y(t) do we pick ? ? ? –INFINITE NUMBER of y(t) PASSING THRU THE SAMPLES, y[n] –D-to-A RECONSTRUCTION MUST CHOOSE ONE OUTPUT RECONSTRUCT THE SMOOTHEST ONE –THE LOWEST FREQ, if y[n] = sinusoid

48 48 SPECTRUM (ALIASING CASE) –0.5  –1.5  0.5  2.5  –2.5  1.5 

49 49 Reconstruction (D-to-A) CONVERT STREAM of NUMBERS to x(t) “CONNECT THE DOTS” INTERPOLATION y(t)y(t) y[k]y[k] kT s (k+1)T s t INTUITIVE, conveys the idea

50 50 SAMPLE & HOLD DEVICE CONVERT y[n] to y(t) –y[k] should be the value of y(t) at t = kT s –Make y(t) equal to y[k] for kT s -0.5T s < t < kT s +0.5T s y(t)y(t) y[k]y[k] kT s (k+1)T s t STAIR-STEP APPROXIMATION

51 51 SQUARE PULSE CASE

52 52 OVER-SAMPLING CASE EASIER TO RECONSTRUCT

53 53 MATH MODEL for D-to-A SQUARE PULSE:

54 54 EXPAND the SUMMATION SUM of SHIFTED PULSES p(t-nT s ) –“WEIGHTED” by y[n] –CENTERED at t=nT s –SPACED by T s RESTORES “REAL TIME”

55 55 p(t)

56 56 OPTIMAL PULSE ? CALLED “BANDLIMITED INTERPOLATION”

57 57 FOLDING DIAGRAM

58 58 ALIASING & FOLDING ALIASING:  x[n] COULD HAVE COME FROM  (f o + f s )  or (f o - f s )  or (f o + 2f s )  or (f o - 2f s ), etc. FOLDING:  A type of ALIASING  x[n] COULD BE FROM:  (-f o + f s )  or (-f o - f s )  or (-f o + 2f s )  or (-f o - 2f s ), etc. x(t) = SINUSOID @ f o SAMPLED SIGNAL: x[n] = x(n/f s )

59 59 D-to-A Reconstruction Create continuous y(t) from y[n] –REALISTIC CONSTRAINT: SMOOTH y(t) Use the lowest possible frequency –y[n] is a list of numbers –How fast? –In MATLAB: soundsc(yy,fs) COMPUTER D-to-AA-to-D x(t)y(t)y[n]x[n]

60 60 FOUR FREQUENCY AXES ANALOG FREQUENCY: f,  DIGITAL FREQUENCY

61 61 FOLDING DERIVATION Negative Freqs can give the same SAME DIGITAL SIGNAL


Download ppt "1 Prof. Nizamettin AYDIN Advanced Digital Signal Processing."

Similar presentations


Ads by Google