2.2 Double Sideband - Suppressed Carrier (DSB-SC)
Group the MATLAB scripts of the following four tasks as one M file, with proper comment lines
to separate the scripts for each task.
Task 1. Generate a DSB signal by mixing the carrier and baseband signal described above. Sample
code is given below.
length (m)-1
carrier = cos(2 * pi * fc * t);
carrier
2.2 Double Sideband-Suppressed Carrier (DSB-SC)
Group the MATLAB scripts of the following four tasks as one M file, with proper comment lines
to separate the scripts for each task.
Task 1. Generate a DSB signal by mixing the carrier and baseband signal described above. Sample code is given below.
t = (0:Ts:(length(m)-i)*Ts));
carrier = cos(2 * pi * fc * t);
Task 2. Select and display a very short duration (100-200 samples) of the modulated DSB-SC signal along with the corresponding baseband voice signal, avoiding the pause periods of your voice. Comments on the two waveforms.
Task 3. Display the spectrum of the modulated DSB signal. Identify the signal bandwidth and compare it with that of the baseband signal.
Task 4. Use a synchronous detector to demodulate the above DSB signal, by first mixing the DSB signal with the carrier signal, and then passing it through a low pass filter. Properly choose the cutoff frequency of the filter and explain how you make the choice. Sample code is shown below to build a Butterworth LPF. You should choose the parameters of the LPF according to your signal.
d = fdesign.lowpass('Fp,Fst,Ap,Ast',0.15,0.3,0.5,40)
Hd = designd,'butter';
fvtool(Hd) % you may display the frequency response of the filter
Note that the passband frequency and stopband frequency are defined as normalized frequencies, i.e., f/(fs/2). For instance, the passband frequency Fp in the above code is 0.15 * fs/2 Hz. To use actual analog frequency in Hz as arguments, you add the sample frequency in the end. For example,
s = 44.1 * 1000;
d = fdesign.lowpass('Fp,Fst,Ap,Ast',5000,8000,0.5,40, fs);
Alternatively, you may use MATLAB function but te. For example fs = 44.1 * 1000;
ts = i/is;
fc = 5000;
scutoff frequency in Hz
[b,a] = butter(4,fc/fs/2);
tconvert to normalized frequency
The MATLAB command filter will evaluate the output of the filter given the input of the filter, as shown below.
output = filter(Hd,input);
sfilter output
or
dataout m filter(b,a,input);
e b and a as numerator, denominator % coefficients
You should display the frequency response of the LPF, the spectrum plots of the input signal to the LPF, and the waveform and spectrum plots of the final output of the demodulator. Comments on the demodulated signals compared to the modulating baseband waveform.