Chapter 7 Over-Sampling and Multi-Rate DSP Systems.

Slides:



Advertisements
Similar presentations
Analog to digital conversion
Advertisements

| Page Angelo Farina UNIPR | All Rights Reserved | Confidential Digital sound processing Convolution Digital Filters FFT.
Learning Introductory Signal Processing Using Multimedia 1 Outline Overview of Information and Communications Some signal processing concepts Tools available.
DCSP-13 Jianfeng Feng
Pulse Code Modulation Pulse Code Modulation
EET260: A/D and D/A conversion
Analog Communications
Analog Representations of Sound Magnified phonograph grooves, viewed from above: When viewed from the side, channel 1 goes up and down, and channel 2 goes.
Chapter 3: Pulse Code Modulation
Speech Coding Workshop 2000 Jean-Marc Valin, Roch Lefebvre 1 IEEE Speech Coding Workshop Sept 17–20, 2000 Lake Lawn Resort Delavan, WI Jean-Marc Valin,
Vibrationdata 1 Unit 10 Sample Rate, Nyquist Frequency & Aliasing.
Department of Kinesiology and Applied Physiology Spectrum Estimation W. Rose
Chapter 11 Signal Processing with Wavelets. Objectives Define and illustrate the difference between a stationary and non-stationary signal. Describe the.
Chapter 4 sampling of continous-time signals 4.5 changing the sampling rate using discrete-time processing 4.1 periodic sampling 4.2 discrete-time processing.
Symmetry and the DTFT If we know a few things about the symmetry properties of the DTFT, it can make life simpler. First, for a real-valued sequence x(n),
The Discrete Fourier Transform. The spectrum of a sampled function is given by where –  or 0 .
Chapter 14 Finite Impulse Response (FIR) Filters.
ECE 4371, Fall, 2014 Introduction to Telecommunication Engineering/Telecommunication Laboratory Zhu Han Department of Electrical and Computer Engineering.
Filtering Filtering is one of the most widely used complex signal processing operations The system implementing this operation is called a filter A filter.
EE381K-14 Multidimensional DSP Multidimensional Resampling Lecture by Prof. Brian L. Evans Scribe: Serene Banerjee Dept. of Electrical and Comp. Eng. The.
CHAPTER 4 DIGITAL MODULATION Part 1.
So far We have introduced the Z transform
Sampling and quantization Seminary 2. Problem 2.1 Typical errors in reconstruction: Leaking and aliasing We have a transmission system with f s =8 kHz.
Quantization Prof. Siripong Potisuk.
Introduction to D/A and A/D conversion Professor: Dr. Miguel Alonso Jr.
CEN352, Dr. Ghulam Muhammad King Saud University
Overview of Adaptive Multi-Rate Narrow Band (AMR-NB) Speech Codec
Sampling, Reconstruction, and Elementary Digital Filters R.C. Maher ECEN4002/5002 DSP Laboratory Spring 2002.
Design Goal Design an Analog-to-Digital Conversion chip to meet demands of high quality voice applications such as: Digital Telephony, Digital Hearing.
Lecture 4: Sampling [2] XILIANG LUO 2014/10. Periodic Sampling  A continuous time signal is sampled periodically to obtain a discrete- time signal as:
Department of Electrical & Computer Engineering 1 ES585a - Computer Based Power System Protection Course by Dr.T.S.Sidhu - Fall 2005 Class discussion presentation.
Digital to Analogue Conversion Natural signals tend to be analogue Need to convert to digital.
Over-Sampling and Multi-Rate DSP Systems
Hossein Sameti Department of Computer Engineering Sharif University of Technology.
Chapter 4: Sampling of Continuous-Time Signals
FT Representation of DT Signals:
EE513 Audio Signals and Systems Digital Signal Processing (Systems) Kevin D. Donohue Electrical and Computer Engineering University of Kentucky.
Formatting and Baseband Modulation
Ni.com Data Analysis: Time and Frequency Domain. ni.com Typical Data Acquisition System.
Sampling Theorems. Periodic Sampling Most signals are continuous in time. Example: voice, music, images ADC and DAC is needed to convert from continuous-time.
Filters and Delta Sigma Converters
Chapter 4 The Frequency Domain of Signals and Systems.
1 Lab. 4 Sampling and Rate Conversion  Sampling:  The Fourier transform of an impulse train is still an impulse train.  Then, x x(t) x s (t)x(nT) *
Pulse Code Modulation Pulse Code Modulation (PCM) : method for conversion from analog to digital waveform Instantaneous samples of analog waveform represented.
19 Nov'08Comp30291 Sectn 61 UNIVERSITY of MANCHESTER School of Computer Science Comp30291 : Digital Media Processing Section 6 Sampling & Reconstruction.
Hossein Sameti Department of Computer Engineering Sharif University of Technology.
Figure Analog-to-digital conversion.. Figure The DAC output is a staircase approximation to the original signal. Filtering removes the sharp.
Nov'04CS3291 Sectn 71 UNIVERSITY of MANCHESTER Department of Computer Science CS3291 : Digital Signal Processing ‘05 Section 7 Sampling & Reconstruction.
Sampling Rate Conversion by a Rational Factor, I/D
Sistem Telekomunikasi, Sukiswo, ST, MT Sukiswo
Presented by Jim Seton Prepared by Jim Seton
Multirate Signal Processing* Tutorial using MATLAB**
Speech Signal Processing
Analog to digital conversion
Chapter 3 Sampling.
SAMPLING & ALIASING.
Sampling rate conversion by a rational factor
EE Audio Signals and Systems
Digital Control Systems Waseem Gulsher
Chapter 2 Signal Sampling and Quantization
لجنة الهندسة الكهربائية
Sampling and the Discrete Fourier Transform
Digital Control Systems Waseem Gulsher
DEPARTMENT OF INFORMATION TECHNOLOGY DIGITAL SIGNAL PROCESSING UNIT 4
9.3 Analog-to-Digital Conversion
Research Methods in Acoustics Lecture 8: Digital systems and filters
CEN352, Dr. Ghulam Muhammad King Saud University
DEPARTMENT OF INFORMATION TECHNOLOGY DIGITAL SIGNAL PROCESSING UNIT 4
Chapter 9 Advanced Topics in DSP
ELEN E4810: Digital Signal Processing Topic 11: Continuous Signals
Presentation transcript:

Chapter 7 Over-Sampling and Multi-Rate DSP Systems

Objectives Describe the anti-aliasing problem and its solution with over-sampling. Demonstrate the details of digital anti-aliasing and anti-imaging. Demonstrate the processes of down-sampling (decimation) and up- sampling (interpolation) to change the effective sampling rate of a digital signal. Show that interpolation is accomplished by up-sampling and a gain-adjusted low-pass filter. Demonstrate the process of rational rate conversion by cascaded interpolation and decimation. Derive the relationship between sampling rate and the spectral density of random noise. Demonstrate the de-noising of signals with over-sampling. Describe the process of delta-sigma quantization and derive the transfer functions for a first-order noise-shaping quantizer. Demonstrate the process of delta-sigma quantization and the recovery of a quantized signal by low-pass filtering

The Anti-Aliasing Problem If a signal contains a band-width of interest, W, then the minimum sampling frequency is 2W (Nyquist requirement) However, to prevent aliasing, the signal must be analog pre-filtered to a band-width of f s /2 prior to sampling If the signal contains frequency components or noise beyond W, the analog low-pass filter (anti-aliasing filter) must be impractically sharp if sampling is done at 2W Solution: Multi-rate processing – Over-sample the signal at a rate considerably higher than 2W and band-width limit the signal with a sharp digital low-pass filter –Down-sample the signal digitally to an effective rate 2W after digital filtering –This allows the use of a simple analog anti-aliasing filter

Why Does Over-Sampling Help Anti-Aliasing? 1f s 0f s 2f s Over-sampled WW Nyquist-sampled WW Magnitude Responses of Required Anti- Aliasing Analog Filters

Aliasing Noise Example Suppose a communications speech signal has a bandwidth of interest of 4 kHz. The signal is bandwidth-limited by a 2 nd order Butterworth analog filter (fc = 4 kHz) prior to sampling. Compare the aliasing noise at 3 kHz for: –fs = 8 kHz (Nyquist sampling) –fs = 128 kHz (16x over-sampling)

Aliasing Noise Example % Use M-file ALIASNOISE=alias_effect_mag(filterorder,fc,fs,f1 >> alias_effect_mag(2,4000,8000,3000); figure, >> alias_effect_mag(2,4000,128e3,3000 );

Digital Anti-Aliasing and Anti-Imaging Simple Analog LP Filter High Rate Sampling (ADC) Digital LP Filter Down-sample to Nyquist Rate Up-sample to high rate Digital LP FilterDAC at High Rate Simple Analog LP Filter Anti-Aliasing Step Anti-Imaging Step Decimation Interpolation

Down-Sampling and Decimation Removal of samples is called down-sampling Down-sampling by a factor N reduces the effective sampling frequency by the same factor. That is, the new sampling frequency is f s /N To prevent aliasing, the down-sampled signal should be band-width limited to f s /2N by low- pass filtering prior to sample removal Low-pass filtering followed by down-sampling is called decimation

Down-Sampling a Sinusoid >> [ysin,tsin]=analog(100,1,30,8000); >> stem(ysin),title('100 Hz Sinusoid Sampled at 8 kHz') >> xlabel('Sample') >> dysin=downsample(ysin,4); >> figure,stem(dysin); >> title('100 Hz Sinusoid Sampled at 8 kHz, Down-Sampled by 4x') >> xlabel('Sample')

Down-Sampling a Sinusoid

Decimation With decimation, low-pass filtering precedes down-sampling to prevent aliasing. Example: Decimating a 100 & 1200 Hz signal by a factor of 4 with the MATLAB decimate command >> x=analog([100,1200],[1,1],1000,8000); >> xd4=downsample(x,4); % Effective sampling frequency is now 2000 Hz >> xdecim4=decimate(x,4); % The LP filter will have a cut-off of 0.8*(8000/8) = 800 Hz and will remove the 1200 Hz component >> subplot(3,1,1),dtft_demof(x,0,1500,2024,8000); >> title('Original Signal') >> subplot(3,1,2),dtft_demof(xd4,0,1500,2024,2000); >> title('Down-Sampled (Aliasing)') >> subplot(3,1,3),dtft_demof(xdecim4,0,1500,2024,2000); >> title('Decimated (No 1200 Hz Aliasing)')

Decimation Example

Up-Sampling and Interpolation The process of adding zero-valued samples between existing samples is called up- sampling Up-sampling by a factor N effectively increases the sampling frequency to Nf s Estimating the values between existing samples is called interpolation Interpolation is accomplished by low-pass filtering an up-sampled signal followed by an amplitude correction to restore the signal power.

Down-Sampling and Up-Sampling 100 Hz Hz Signal >> [x,ts]=analog([100,200],[1,1],20,2000); % Construct a short version of the signal >> xd4=downsample(x,4); >> xu4=upsample(xd4,4); >> subplot(3,1,1),stem(x),title('Original Signal') >> subplot(3,1,2),stem(xd4),title('Down-Sampled by 4') >> subplot(3,1,3),stem(xu4),title('Down-Sampled Signal Up-Sampled by 4x') >> xlabel('Sample')

Down-Sampling and Up-Sampling

Spectra of the Down-Sampled and Up-Sampled Signals

Interpolation Process The spectrum of the up-sampled signal gives the clue for the process –Low-pass filter the up-sampled signal to remove all frequency components beyond f s /2N, where f s = effective sampling frequency after up-sampling and N is the up-sampling factor. –Multiply the result by N to restore the correct the power of the up-sampled signal Typical filter order for the low-pass filter is 8N This process is implemented in the MATLAB interp command, using a special symmetric FIR filter to compensate for group delay

Recovery of a Down-Sampled Signal by Interpolation Filtering >> x=analog([100,200],[1,1],1000,2000); %Construct the signal >> xd4=downsample(x,4); >> xu4=upsample(xd4,4); >> n=0:32; % Begin the design of an order 8N filter LP filter >> fs=2000; >> N=4; >> cutoff=fs/(2*N); >> omega=2*pi*cutoff/fs; >> h=(omega/pi)*sinc(omega*(n-16)/pi).*hamming(33)'; % LP filter >> x_recovered=4*filter(h,1,xu4); % LP filter and multiply by N=4 >> subplot(3,1,1);stem(x(1:100)),title('Original Signal') >> subplot(3,1,2);stem(xu4(1:100)),title('Zero Insertion of Down- Sampled Signal') >> subplot(3,1,3);stem(x_recovered(1:100)),title('Recovered (LP Filtered) Signal')

Interpolation Recovery Results Note that the group delay of the LP filter is 16 in this example

Interpolation with interp >> x=analog([100,200],[1,1],1000,2000); %Construct the signal >> xd4=downsample(x,4); >> xu4=upsample(xd4,4); >> x_interp=interp(xd4,4); >> subplot(3,1,1),stem(x(1:100)),title('Original Signal') >> subplot(3,1,2),stem(xd4(1:25)),title('Down-Sampled Signal') >> subplot(3,1,3),stem(x_interp(1:100)),title('Recovered Signal Using "interp"')

Interp Results

Sampling Rate Conversion by Rational Factors The sampling frequency can be changed by rational factors L/M where L is the interpolation factor and M is the decimation factor. Rate changes (to higher or lower rates) is always done with interpolation (L) and decimation (M) in that order to prevent loss of frequency components of interest in the signal. Example: Changing a music signal from the CD rate (44.1 kHz) to the digital tape rate (48 kHz) is accomplished by interpolation by a factor of 160 followed by decimation by a factor of 147

Rate Conversion Example Convert a 100 Hz sinusoidal signal sampled at 1200 Hz to a signal sampled at 1000 Hz L/M=1000/1200 = 5/6 >> x=analog(100,1,40,1200); >> xL=interp(x,5); % The interp command carries out interpolation >> xLM=decimate(xL,6); % decimate carries out decimation >> subplot(2,1,1),stem(x),title(' Signal, fs = 1.2 kHz') >> subplot(2,1,2),stem(xLM),title('Rate Conversion 1.2 kHz to 1 kHz') >> axis([0,50,-1,1])

Rate Conversion Example Results Note in both cases the signal is about 40 ms long.

Over-Sampling and Random Noise Gaussian noise power is uniformly distributed in the frequency domain As a consequence, noise power density is reduced by a factor of 2 (3 dB) for each doubling of the sampling frequency.

Power Density in the Frequency Domain

Calculating Mean Noise Power Density for Different Sampling Frequencies >> [zero_sig,tt]=analog(1,0,1000,50000); %Construct a psuedo-analog zero signal >> analog_noise=zero_sig+randn(size(zero_sig)); % Construct a psuedo-analog noise signal >> n1000=sample(tt,analog_noise,1000); % Sample the noise signal at 1 kHz, 2 kHz, and 4 kHz >> n2000=sample(tt,analog_noise,2000); >> n4000=sample(tt,analog_noise,4000); >> [N1,f1]=dtft_demof(n1000,0,500,512,1000); % Compute the DTFT for each digital noise signal >> [N2,f2]=dtft_demof(n2000,0,1000,512,2000); >> [N4,f4]=dtft_demof(n4000,0,2000,512,4000); >> pd1=(abs(N1)).^2/(length(n1000)*1000); % Compute the spectral power density >> pd2=(abs(N2)).^2/(length(n2000)*2000); >> pd4=(abs(N4)).^2/(length(n4000)*4000); >> mean(pd1) % Compute the mean value of the spectral power density >> mean(pd2) >> mean(pd4) ans = e-004 ans = e-004 ans = e-004 Notice than the average power density is reduced by a factor of 2 for each doubling of the sampling frequency

De-Noising a Signal by Over-Sampling and Low-Pass Filtering Over-sample a signal at a rate many times higher than the band-width of interest W Over-sampling reduces the noise power in W by 3 dB for each doubling of the sampling frequency Low-pass filter with a cut-off frequency near W. This eliminates the noise power at frequencies beyond W.

De-Noising Example >> [asig,tt]=analog(100,1,40,40000); >> asign=asig+randn(size(asig)); >> [d8,t8]=sample(tt,asig,8000); >> [d8n,t8]=sample(tt,asign,8000); >> n=0:100; >> omega=2*pi*125/8000; >> hw=(omega/pi)*sinc(omega*(n-50)/pi).*blackman(101)'; >> d8nf=filter(hw,1,d8n); >> subplot(3,1,1),plot(t8,d8),title('Clean Signal') >> subplot(3,1,2),plot(t8,d8n),title('Noisy Signal') >> subplot(3,1,3),plot(t8,d8nf),title('Filtered Noisy Signal') >> subplot(2,1,1),fft_plot(d8n,8000);title('Noisy Signal Spectrum') >> subplot(2,1,2),fft_plot(d8nf,8000);title('Filtered Noisy Signal Spectrum')

De-Noising Example Results

Noise Power Uniformly Distributed Noise Power Eliminated by LP Filter

Delta-Sigma (ΔΣ) Quantization The processing speed of a DSP system could be measured by bits/sec in which case the speed is Nf s, where N is the number of quantization bits (ADC) and f s is the sampling frequency. For a given system speed, the maximum f s requires quantization with one bit, which appears impossible because quantization with two levels implies impractically high quantization noise. ΔΣ Quantization can do just that: quantize with 1 bit and still control the quantization noise.

Delta-Sigma Quantizer Functional Diagram

Delta-Sigma Quantizer Discrete-Time Model Output = input x delay + noise x high-pass filter (e.g, Noise-shaping one-bit quantization)

Delta-Sigma Quantization of a Sinusoid >> [x,ts]=analog(100,2,500,10000); >> stem(ts(1:100),x(1:100)) >> title('High-Rate Sampled 100 Hz Sinusoid') >> xlabel('milliseconds') >> [x,ts]=analog(100,2,500,10000); >> stem(ts(1:100),x(1:100)) >> title('High-Rate Sampled 100 Hz Sinusoid') >> xlabel('milliseconds') >> y=deltasigma(x); % This is the delta-sigma quantizer algorithm >> figure,stem(y(1:100)); >> hold >> plot(x(1:100),'k') >> title('Delta-Sigma Quantizer Output for 100 Hz Sinusoid') >> xlabel('Output Sample') >> hold off

Delta-Sigma Quantization of a Sinusoid

8-bit Running Average of the Delta-Sigma Quantized Sine

Delta-Sigma Quantization of a Sinusoid – Quantization Noise Shaping Low-pass filtering would eliminate the quantization noise

Low-Pass Filtering Δ-Σ Sinusoid >> n=0:500; >> omega=2*pi*200/10000; >> h=(omega/pi)*sinc(omega*(n-250)/pi); >> hb200=h.*blackman(501)'; >> [x,ts]=analog(100,2,500,10000); >> y=deltasigma(x); % This is the delta-sigma quantizer algorithm >> y_lpf=filter(hb200,1,y); >> fft_plot(y_lpf,10000); >> title('Spectrum of Low-Pass Filtered Delta-Sigma Quantizer Output') >> figure,plot(ts(1:500),y_lpf(1:500)) >> title('Time-Domain of the Filtered Quantizer Output') >> xlabel('Milliseconds')

Low-Pass Filtering Δ-Σ Sinusoids Filter group delay

Processing a Δ-Σ Signal Delta-Sigma Quantizer Serial-to-N-bit Parallel Converter Low-Pass Filter Decimation to Nyquist Rate Binary stream (f s ) N-bit numbers (f s /N) Recovered Signal Continue Processing

Processing a Δ-Σ Signal The high-rate sampling frequency of the Δ-Σ quantizer is f s. Over N samples, the bit-stream of the Δ-Σ quantizer output is the average signal value. Serial-to-N-bit parallel conversion creates N-bit numbers equal to the average value. The effective sampling frequency is f s /N. The N-bit numbers carry the quantization noise which is eliminated by digital LP filtering. The filtered signal represents the recovered signal. After filtering the signal can be decimated to the Nyquist rate for further processing.

Processing a Δ-Σ Signal MATLAB Simulation % Create and Delta-Sigma Quantize a Signal with 100, 200, and 300 Hz Components >> x=analog([100,200,300],[1,1,1],1000,24000); % Sampled signal >> y=deltasigma(x); % Delta-sigma quantization of the signal % % Simulate the 8-Bit Serial to Parallel Conversion of the Quantizer Stream >> y8bits=decimate_and_average(y,8); % M-file to block process the signal y in blocks of 8 % % Low-Pass Filter the 8-Bit Signal with Cutoff of 350 Hz >> n=0:100; % Start low-pass filter design >> fs=24000/8; % The signal has been effectively decimated by a factor of 8 >> omega=2*pi*350/fs; >> h=(omega/pi)*sinc(omega*(n-50)/pi).*hamming(101)'; % Windowed LP filter >> yfilt=filter(h,1,y8bits); % Low-pass filter the 8-bit re-quantized signal % % Decimate the filtered signal to the Nyquist Rate >> ydec=decimate(yfilt,4); % Decimate the filtered signal by a factor of 4 (fs = 750 Hz)

Processing a Δ-Σ Signal MATLAB Simulation Signals (10 ms period) >> t24=0:1000/24000:10; >> stem(t24(1:240),y(1:240)) >> hold %Current plot held >> plot(t24(1:240),x(1:240),'k') >> legend('Quanitzer output and sampled signal') >> hold off >> t3k=0:(1/3):10; >> stem(t3k(1:30),y8bits(1:30)) >> hold %Current plot held >> plot(t24(1:240),x(1:240),'k') >> legend('8-bit samples and sampled signal') >> hold off

Processing a Δ-Σ Signal MATLAB Simulation Signals (10 ms period) >> stem(t3k(1:30),yfilt(81:110)) >> hold %Current plot held >> plot(t24(1:240),x(245:484),'k') >> legend('LP filtered 8-bit samples and sampled signal') >> hold off >> tf=downsample(t3k(1:30),4); >> yfiltf=downsample(yfilt(81:110),4); >> stem(tf,yfiltf) >> hold %Current plot held >> plot(t24(1:240),x(245:484),'k') >> legend('Decimated final signal and sampled signal') >> hold off

Processing a Δ-Σ Signal MATLAB Simulation Sampled Signal Spectrum >> dtft_demof(x,0,1500,4000,24000); % Begin generating signal spectra >> legend('Spectrum of the sampled signal')

Processing a Δ-Σ Signal MATLAB Simulation Quantizer and 8-Bit Signal Spectra (Showing Quantization Noise) >> figure,dtft_demof(y,0,1500,4000,24000); >> legend('Spectrum of the delta-sigma quantizer output') >> figure, dtft_demof(y8bits,0,1500,4000,3000); >> legend('Spectrum of the 8-bit serial-to-parallel signal')

Processing a Δ-Σ Signal MATLAB Simulation 8-Bit Signal LP Filtered and Decimated (Quantization Noise Minimized) >> figure, dtft_demof(yfilt,0,1500,4000,3000); >> legend('Spectrum of the low-pass filtered 8-bit signal (recovered signal)') >> figure,dtft_demof(ydec,0,1500,4000,750); >> legend('Final signal decimated by 4 (fs = 750 Hz)')

Reduction in Noise due to Over-sampling and Noise Shaping

Summary The spectral content of a digital signal is replicated at integer multiples of the sampling frequency. Oversampling (sampling well beyond the Nyquist rate) spreads the frequency content over a wider frequency range. The requirements on the analog anti-aliasing filter can be relaxed by oversampling followed by digital low-pass filtering. The extra samples in an oversampled and bandwidth-limited signal can be removed by downsampling or decimation, thereby reducing the effective sampling frequency. A signal can be restored to a higher sampling frequency by the processes of upsampling and interpolation. Since Gaussian noise is uniformly distributed in the frequency domain, the combination of oversampling and filtering can effectively de-noise a signal in a bandwidth of interest. Oversampling can be maximized by delta-sigma quantization, which is quantization with one bit. Delta-sigma quantizers have the property of noise-shaping, which allows the elimination of quantization noise by low-pass filtering.