Advanced Digital Signal Processing Prof Nizamettin AYDIN naydinyildiz





![SAMPLING x(t) • SAMPLING PROCESS • Convert x(t) to numbers x[n] • “n” is SAMPLING x(t) • SAMPLING PROCESS • Convert x(t) to numbers x[n] • “n” is](https://slidetodoc.com/presentation_image_h2/765f129eddee5441aff70b9c7ff019c7/image-6.jpg)




![STORING DIGITAL SOUND • x[n] is a SAMPLED SINUSOID – A list of numbers STORING DIGITAL SOUND • x[n] is a SAMPLED SINUSOID – A list of numbers](https://slidetodoc.com/presentation_image_h2/765f129eddee5441aff70b9c7ff019c7/image-11.jpg)
![DISCRETE-TIME SINUSOID • Change x(t) into x[n] DERIVATION DEFINE DIGITAL FREQUENCY 12 DISCRETE-TIME SINUSOID • Change x(t) into x[n] DERIVATION DEFINE DIGITAL FREQUENCY 12](https://slidetodoc.com/presentation_image_h2/765f129eddee5441aff70b9c7ff019c7/image-12.jpg)


![SPECTRUM (DIGITAL) ? ? – 2 p 2 p(1) x[n] is zero frequency? ? SPECTRUM (DIGITAL) ? ? – 2 p 2 p(1) x[n] is zero frequency? ?](https://slidetodoc.com/presentation_image_h2/765f129eddee5441aff70b9c7ff019c7/image-15.jpg)
![The REST of the STORY • Spectrum of x[n] has more than one line The REST of the STORY • Spectrum of x[n] has more than one line](https://slidetodoc.com/presentation_image_h2/765f129eddee5441aff70b9c7ff019c7/image-16.jpg)




![SPECTRUM for x[n] • PLOT versus NORMALIZED FREQUENCY • INCLUDE ALL SPECTRUM LINES – SPECTRUM for x[n] • PLOT versus NORMALIZED FREQUENCY • INCLUDE ALL SPECTRUM LINES –](https://slidetodoc.com/presentation_image_h2/765f129eddee5441aff70b9c7ff019c7/image-21.jpg)




![SIGNAL TYPES x(t) A-to-D x[n] COMPUTER y[n] D-to-A y(t) • A-to-D • Convert x(t) SIGNAL TYPES x(t) A-to-D x[n] COMPUTER y[n] D-to-A y(t) • A-to-D • Convert x(t)](https://slidetodoc.com/presentation_image_h2/765f129eddee5441aff70b9c7ff019c7/image-26.jpg)
![SAMPLING x(t) • UNIFORM SAMPLING at t = n. Ts • IDEAL: x[n] = SAMPLING x(t) • UNIFORM SAMPLING at t = n. Ts • IDEAL: x[n] =](https://slidetodoc.com/presentation_image_h2/765f129eddee5441aff70b9c7ff019c7/image-27.jpg)

![SPECTRUM for x[n] • INCLUDE ALL SPECTRUM LINES – ALIASES • ADD INTEGER MULTIPLES SPECTRUM for x[n] • INCLUDE ALL SPECTRUM LINES – ALIASES • ADD INTEGER MULTIPLES](https://slidetodoc.com/presentation_image_h2/765f129eddee5441aff70b9c7ff019c7/image-29.jpg)
![EXAMPLE: SPECTRUM • x[n] = Acos(0. 2 pn+f) • FREQS @ 0. 2 p EXAMPLE: SPECTRUM • x[n] = Acos(0. 2 pn+f) • FREQS @ 0. 2 p](https://slidetodoc.com/presentation_image_h2/765f129eddee5441aff70b9c7ff019c7/image-30.jpg)


![FOLDING (a type of ALIASING) • EXAMPLE: 3 different x(t); same x[n] • 900 FOLDING (a type of ALIASING) • EXAMPLE: 3 different x(t); same x[n] • 900](https://slidetodoc.com/presentation_image_h2/765f129eddee5441aff70b9c7ff019c7/image-33.jpg)


![FREQUENCY DOMAINS x(t) A-to-D x[n] y[n] D-to-A y(t) 44 FREQUENCY DOMAINS x(t) A-to-D x[n] y[n] D-to-A y(t) 44](https://slidetodoc.com/presentation_image_h2/765f129eddee5441aff70b9c7ff019c7/image-36.jpg)
![D-to-A Reconstruction x(t) A-to-D x[n] COMPUTER y[n] D-to-A y(t) • Create continuous y(t) from D-to-A Reconstruction x(t) A-to-D x[n] COMPUTER y[n] D-to-A y(t) • Create continuous y(t) from](https://slidetodoc.com/presentation_image_h2/765f129eddee5441aff70b9c7ff019c7/image-37.jpg)
![D-to-A is AMBIGUOUS ! • ALIASING – Given y[n], which y(t) do we pick D-to-A is AMBIGUOUS ! • ALIASING – Given y[n], which y(t) do we pick](https://slidetodoc.com/presentation_image_h2/765f129eddee5441aff70b9c7ff019c7/image-38.jpg)


![SAMPLE & HOLD DEVICE • CONVERT y[n] to y(t) – y[k] should be the SAMPLE & HOLD DEVICE • CONVERT y[n] to y(t) – y[k] should be the](https://slidetodoc.com/presentation_image_h2/765f129eddee5441aff70b9c7ff019c7/image-41.jpg)



![EXPAND the SUMMATION • SUM of SHIFTED PULSES p(t-n. Ts) – “WEIGHTED” by y[n] EXPAND the SUMMATION • SUM of SHIFTED PULSES p(t-n. Ts) – “WEIGHTED” by y[n]](https://slidetodoc.com/presentation_image_h2/765f129eddee5441aff70b9c7ff019c7/image-45.jpg)


- Slides: 47
Advanced Digital Signal Processing Prof. Nizamettin AYDIN naydin@yildiz. edu. tr http: //www. yildiz. edu. tr/~naydin 1
Sampling & Aliasing 2
LECTURE OBJECTIVES • SAMPLING can cause ALIASING – Sampling Theorem – Sampling Rate > 2(Highest Frequency) • Spectrum for digital signals, x[n] – Normalized Frequency ALIASING 3
SYSTEMS Process Signals x(t) SYSTEM y(t) • PROCESSING GOALS: – Change x(t) into y(t) • For example, more BASS – Improve x(t), e. g. , image deblurring – Extract Information from x(t) 4
System IMPLEMENTATION • ANALOG/ELECTRONIC: • Circuits: resistors, capacitors, op-amps x(t) ELECTRONICS y(t) • DIGITAL/MICROPROCESSOR • Convert x(t) to numbers stored in memory x(t) A-to-D x[n] COMPUTER y[n] D-to-A y(t) 5
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 = n. Ts • IDEAL: x[n] = x(n. Ts) x(t) C-to-D x[n] 6
SAMPLING RATE, fs • SAMPLING RATE (fs) – fs =1/Ts • NUMBER of SAMPLES PER SECOND – Ts = 125 microsec fs = 8000 samples/sec – UNITS ARE HERTZ: 8000 Hz • UNIFORM SAMPLING at t = n. Ts = n/fs – IDEAL: x[n] = x(n. Ts)=x(n/fs) x(t) C-to-D x[n]=x(n. Ts) 7
8
SAMPLING THEOREM • HOW OFTEN ? – DEPENDS on FREQUENCY of SINUSOID – ANSWERED by SHANNON/NYQUIST Theorem – ALSO DEPENDS on “RECONSTRUCTION” 9
Reconstruction? Which One? Given the samples, draw a sinusoid through the values 10
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 11
DISCRETE-TIME SINUSOID • Change x(t) into x[n] DERIVATION DEFINE DIGITAL FREQUENCY 12
DIGITAL FREQUENCY • VARIES from 0 to 2 p, as f varies from 0 to the sampling frequency • UNITS are radians, not rad/sec – DIGITAL FREQUENCY is NORMALIZED 13
SPECTRUM (DIGITAL) – 0. 2 p 2 p(0. 1) 14
SPECTRUM (DIGITAL) ? ? – 2 p 2 p(1) x[n] is zero frequency? ? ? 15
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 p – Because 16
ALIASING DERIVATION • Other Frequencies give the same 17
ALIASING DERIVATION– 2 • Other Frequencies give the same 18
ALIASING CONCLUSIONS • ADDING fs or 2 fs or –fs to the FREQ of x(t) gives exactly the same x[n] – The samples, x[n] = x(n/ fs ) are EXACTLY THE SAME VALUES • GIVEN x[n], WE CAN’T DISTINGUISH fo FROM (fo + fs ) or (fo + 2 fs ) 19
NORMALIZED FREQUENCY • DIGITAL FREQUENCY 20
SPECTRUM for x[n] • PLOT versus NORMALIZED FREQUENCY • INCLUDE ALL SPECTRUM LINES – ALIASES • ADD MULTIPLES of 2 p • SUBTRACT MULTIPLES of 2 p – FOLDED ALIASES • ALIASES of NEGATIVE FREQS 21
SPECTRUM (MORE LINES) – 1. 8 p – 0. 2 p 2 p(0. 1) 1. 8 p 22
SPECTRUM (ALIASING CASE) – 2. 5 p – 1. 5 p – 0. 5 p 1. 5 p 23
SPECTRUM (FOLDING CASE) – 1. 6 p – 0. 4 p 1. 6 p 24
D-to-A Conversion 33
SIGNAL TYPES x(t) A-to-D x[n] COMPUTER y[n] D-to-A y(t) • 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 34
SAMPLING x(t) • UNIFORM SAMPLING at t = n. Ts • IDEAL: x[n] = x(n. Ts) x(t) C-to-D x[n] 35
NYQUIST RATE • “Nyquist Rate” Sampling – fs > 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 36
SPECTRUM for x[n] • INCLUDE ALL SPECTRUM LINES – ALIASES • ADD INTEGER MULTIPLES of 2 p and -2 p – FOLDED ALIASES • ALIASES of NEGATIVE FREQS • PLOT versus NORMALIZED FREQUENCY – i. e. , DIVIDE fo by fs 37
EXAMPLE: SPECTRUM • x[n] = Acos(0. 2 pn+f) • FREQS @ 0. 2 p and -0. 2 p • ALIASES: – {2. 2 p, 4. 2 p, 6. 2 p, …} & {-1. 8 p, -3. 8 p, …} – EX: x[n] = Acos(4. 2 pn+f) • ALIASES of NEGATIVE FREQ: – {1. 8 p, 3. 8 p, 5. 8 p, …} & {-2. 2 p, -4. 2 p …} 38
SPECTRUM (MORE LINES) – 1. 8 p – 0. 2 p 2 p(0. 1) 1. 8 p 39
SPECTRUM (ALIASING CASE) – 2. 5 p – 1. 5 p – 0. 5 p 1. 5 p 2. 5 p 40
FOLDING (a type of ALIASING) • EXAMPLE: 3 different x(t); same x[n] • 900 Hz “folds” to 100 Hz when fs=1 k. Hz 41
DIGITAL FREQ AGAIN ALIASING FOLDED ALIAS 42
SPECTRUM (FOLDING CASE) – 1. 6 p – 0. 4 p 1. 6 p 43
FREQUENCY DOMAINS x(t) A-to-D x[n] y[n] D-to-A y(t) 44
D-to-A Reconstruction x(t) A-to-D x[n] COMPUTER y[n] D-to-A y(t) • Create continuous y(t) from y[n] – IDEAL • If you have formula for y[n] – Replace n in y[n] with fst – y[n] = Acos(0. 2 pn+f) with fs = 8000 Hz – y(t) = Acos(2 p(800)t+f) 46
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 47
SPECTRUM (ALIASING CASE) – 2. 5 p – 1. 5 p – 0. 5 p 1. 5 p 2. 5 p 48
Reconstruction (D-to-A) • CONVERT STREAM of NUMBERS to x(t) • “CONNECT THE DOTS” • INTERPOLATION INTUITIVE, conveys the idea y[k] y(t) k. Ts (k+1)Ts t 49
SAMPLE & HOLD DEVICE • CONVERT y[n] to y(t) – y[k] should be the value of y(t) at t = k. Ts – Make y(t) equal to y[k] for • k. Ts -0. 5 Ts < t < k. Ts +0. 5 Ts y[k] STAIR-STEP APPROXIMATION y(t) k. Ts (k+1)Ts t 50
SQUARE PULSE CASE 51
OVER-SAMPLING CASE EASIER TO RECONSTRUCT 52
MATH MODEL for D-to-A SQUARE PULSE: 53
EXPAND the SUMMATION • SUM of SHIFTED PULSES p(t-n. Ts) – “WEIGHTED” by y[n] – CENTERED at t=n. Ts – SPACED by Ts • RESTORES “REAL TIME” 54
p(t) 55
OPTIMAL PULSE ? CALLED “BANDLIMITED INTERPOLATION” 56