
18.3. MATLAB IMPLEMENTATION 307
31 else
I_data =0;
33 Q_data =0;
end
35
% create the modulated signal
37 [ I_IM_data , I_state ]=filter( B ,1 ,amplitude ∗I_data , I_state);
[ Q_IM_data , Q_state ]=filter( B ,1 ,amplitude ∗Q_data , Q_state);
39 output = I_IM_data ∗cosine ( mod ( index ,4) + 1) ...
− Q_IM_data ∗sine( mod ( index ,4) + 1) ;
41
% reset at the end of a symbol period
43 if ( counter == samplesPerSymbol)
counter =0;
45 end
47 % increment the counter
counter = counter +1;
49 end
51 % output terms
% Plotting commands follow ...
An explanation of Listing 18.1 follows.
1. (Line 2): Defines the system’s sample frequency as 48 kHz. This sample frequency
matches ...