Digital Signal Processing Reference
In-Depth Information
% wbsignal.m Generates wide band random sequence.Represents one info bit
len_code = 128; %length of random sequence
code = 2*round(rand(1,len_code))-1; %generates random sequence {1,-1}
sample_rate = 2; %up-sampling from 4 to 8 kHz
NS = len_code * sample_rate; %length of up-sampled sequence
sig = zeros(1,NS); %initialize random sequence
for i = 1:len_code %obtain up-sampled random sequence
sig((i-1)*sample_rate + 1:i*sample_rate) = code(i);
end;
wbsignal = sig*5000; %scale for p-p amplitude of 500 mV
fid=fopen('wbsignal.h','w'); %open file for wideband signal
fprintf(fid,'#define NS 256 //number of output sample points\n\n');
fprintf(fid,'short wbsignal[256]={');
fprintf(fid,'%d, ' ,wbsignal(1:NS-1));
fprintf(fid,'%d' ,wbsignal(NS));
fprintf(fid,'};\n\n');
fclose(fid);
return;
FIGURE 7.25. MATLAB program that generates a desired wideband random sequence
( wbsignal.m ).
The output of the adaptive FIR filter is an estimate of the correlated narrowband
interference. As a result, the error signal E is an estimate of the wideband signal
desired.
Build and run this project as adaptpredict . Apply a sinusoidal input signal
between 1 and 3 kHz, representing the narrowband interference. Run the program
and verify that the output spectrum of the error signal E adapts (converges) to the
desired wideband signal, showing the input interference being gradually reduced.
Change the frequency of the input sinusoidal external interference and observe
the adaptation process repeated to cancel the undesirable external interference. A
faster rate of convergence can be observed by increasing beta by 10.
The wideband signal desired can be observed by outputting wb_signal (in lieu
of E ). Furthermore, the wideband signal with additive interference can be observed
using output_sample( splusn[0] ) . Better results are obtained when the ampli-
tude of the external sinusoidal interference is about three times the amplitude of
the wideband signal desired.
In the next example, an external wideband signal is used in lieu of a software-
generated random sequence.
Search WWH ::




Custom Search