Digital Signal Processing Reference
In-Depth Information
0.00188598835011 0.00578414933758 0.00649330625041 0.00177982369523 .
-0.00670672686935 -0.01319379342716 -0.01116855281442 0.00123034314117 .
0.01775600060894 0.02614700427364 0.01594155162392 -0.01235169936557 .
-0.04334322148505 -0.05244745563466 -0.01951094855292 0.05718573279009 .
0.15568416401644 0.23851539047347 0.27083333333333 0.23851539047347 .
0.15568416401644 0.05718573279009 -0.01951094855292 -0.05244745563466 .
-0.04334322148505 -0.01235169936557 0.01594155162392 0.02614700427364 .
0.01775600060894 0.00123034314117 -0.01116855281442 -0.01319379342716
.
-0.00670672686935 0.00177982369523 0.00649330625041 0.00578414933758
.
0.00188598835011 -0.00174101657599 -0.00300830295487 -0.00203448515158
.
-0.00025059018468 0.00100277549136 0.00123831516738 0.00069976044649
.
-0.00012783931504];
% Generate 2048 samples with fs
¼
8000 Hz
fs ¼ 8000;
% Sampling rate
N ¼ 2048;
% Number of samples
L ¼ 3;
% Upsampling factor
n ¼ 0:1:N-1;
x ¼ 5*sin(n*pi/4) þ cos(5*n*pi/8);
p0 ¼ B(1:L:length(B)); p1 ¼ B(2:L:length(B)); p2 ¼ B(3:L:length(B));
% Interpolation
w0 ¼ filter(p0,1,x);
w1 ¼ filter(p1,1,x);
w2 ¼ filter(p2,1,x);
y0 ¼ zeros(1,L*N);y0(1:L:length(y0)) ¼ w0;
y1 ¼ zeros(1,L*N);y1(1:L:length(y1)) ¼ w1;
y1 ¼ filter([0 1],1,y1);
y2 ¼ zeros(1,L*N);y2(1:L:length(y2)) ¼ w2;
y2 ¼ filter([0 0 1],1,y2);
y ¼ y0 þ y1 þ y2; % Interpolated signal
NL ¼ length(y); % Length of the upsampled data
X ¼ 2*abs(fft(x,N))/N;X(1) ¼ X(1)/2; % Compute the one-sided amplitude
% spectrum
f
¼
[0:1:N/2-1]*fs/N; % Map the frequency index to the frequency (Hz)
Y
¼
2*abs(fft(y,NL))/NL;Y(1)
¼
Y(1)/2; % Compute the one-sided amplitude
% spectrum
fsL
[0:1:NL/2-1]*fs*L/NL; % Map the frequency index to the frequency (Hz)
subplot(2,1,1);plot(f,X(1:1:N/2));grid; xlabel(
¼
);
subplot(2,1,2);plot(fsL,Y(1:1:NL/2));grid; xlabel( ' Frequency (Hz) ' );
Note that wavelet transform and subband coding are also topics in the area of multirate signal
processing. We will pursue these subjects in Chapter 13.
Frequency (Hz)
'
'
12.3 OVERSAMPLING OF ANALOG-TO-DIGITAL CONVERSION
Oversampling of the analog signal has become more popular in the DSP industry to improve the
resolution of analog-to-digital conversion (ADC). Oversampling uses a sampling rate that is much
higher than the Nyquist rate. We can define an oversampling ratio as
Search WWH ::




Custom Search