Digital Signal Processing Reference
In-Depth Information
5
2
0
0
-2
-5
0
100
200
300
400
500
0
100
200
300
400
500
5
2
0
0
-2
-5
0
100
200
300
400
500
0
100
200
300
400
500
5
2
0
0
-2
-5
0
100
200
300
400
500
0
100
200
300
400
500
Sample number
Frequency (Hz)
FIGURE 12.34
Signal comparisons in both the time and frequency domains.
% Sampling at fs
¼
1000 Hz
x
¼
C1*sin(2*pi*f1*n*T)
þ
C2*sin(2*pi*f2*T*n
þ
pi/6)
þ
C3*sin(2*pi*f3*T*n
þ
pi/4);
xq
¼
round(x); % Quantization
NN
length(n);
M ¼ 32*L;nd ¼ M/L; % Delay in terms of samples for anti-aliasing filtering
B ¼ firwd(2*M þ 1,1,2*pi*fmax/fsL,0,4); % Design of an anti-aliasing filter
figure(1)
freqz(B,1,1000,fsL);
% Oversampling
xx ¼ C1*sin(2*pi*f1*nL*TL) þ C2*sin(2*pi*f2*nL*TL þ pi/6) þ C3*sin(2*pi*f3*nL*TL þ pi/4);
% The first-order SDM processing
yq ¼ zeros(1,ntotal*L þ 1 þ 1); % Initializing the buffer
y ¼ yq;
for i ¼ 1:ntotal*L
y(i þ 1) ¼ (xx(i þ 1)-yq(i)) þ y(i);
yq(i þ 1) ¼ round(y(i þ 1));
end
xxq ¼ yq(1:ntotal*L þ 1); % Signal quantization
% Downsampling
y ¼ filter(B,1,xxq);
yd ¼ y(1:L:length(y));
f ¼ [0:ntotal-1]*fs/NN;
¼
 
Search WWH ::




Custom Search