TLT-5200/5206 Communication Theory, Matlab Exercise #4 ∫

advertisement
TLT-5200/5206 Communication Theory, Matlab Exercise #4
General Parameters:
Sampling frequency 20 MHz
Data vector length N=4000
Frequency axis from –Fs/2 to Fs/2 (two-sided).
AM:
xc(t)=(1+μ x (t))cos(2π f ct)
t
FM:
xc (t ) = cos(2π f c t + 2π f d ∫ x(λ ) d λ )
0
DSB:
xc(t)=cos(2π f ct) x (t)
LSSB:
xc(t)=0.5(cos(2π f ct) x (t) + sin(2π f ct) xˆ (t ) ), where xˆ (t ) is the Hilbert transform of x(t).
_____________________________________________________________________
In this exercise, always give two-sided frequency domain plots!
(Refer to 1st exercise if you do not remember how to plot it.)
Furthermore, remember to scale the amplitudes in frequency domain plots!
_____________________________________________________________________
1. Generate an AM-signal x_am, when the modulation index µ=0.6, carrier frequency
f c =5 MHz and modulating signal a sine wave [x(t)=sin(2π f mod t)] with 300 kHz frequency.
- Plot AM-signal in both time and frequency domain.
2. Generate an FM-signal x_fm, when f c =2 MHz, deviation f d =200 kHz, and modulating signal is
a 300 kHz sine wave.
In FM-signal, the integral can be reformulated as
t
1
∫ sin(2π f λ )d λ = (1 − cos(2π f t )) 2π f .
c
0
c
c
As an alternative, the integration can be done numerically in Matlab by function
cumsum(x)/Fs .
- Plot FM-signal in both time and frequency domain.
- Plot the FM-signal in frequency domain to a new figure using logarithmic scale for the yaxis. plot(...,20*log10(...));
Compare to the previous picture. What do you notice?
3. Signal Power and SNR
Signal-to-Noise Ratio, SNR = 10*log10(Ps/Pn))
First, generate white Gaussian noise vector
>> n=randn(size(x_fm));
- Compute FM- and noise signal powers (help var, Pfm = …, Pn=...).
- What is SNR (signal to noise ratio) if FM- and noise signals would be added together?
- What is the needed scaling factor for the noise signal (in dB) to obtain an SNR of 20dB?
- Convert decibels into a linear amplification factor, k=10^(db/20)!
- Sum the FM-signal and scaled noise signal together, and plot the amplitude spectrum in
logarithmic scale, and compare it to the case without noise!
4. Generate DSB (x_dsb) and LSSB (x_lssb) -signals, fc=2 MHz, modulating signal is a sinusoidal
signal of 300 kHz.
Hilbert transform
>>xh=imag(hilbert(x)); % You need this to generate LSSB signal, see HELP HILBERT
- Compute the amplitude spectrums of DSB and LSSB, i.e., Fdsb and Flssb, and plot
them in the same figure (see help subplot ):
- What is the difference?
5. Filter design
- Design 10th order Butterworth filter, whose cut-off frequency is 2 MHz
>> order=10; % filter order
>> fr=2e6/(Fs/2); % Cut-off frequency normalized to 1.
>> [B,A]=butter(order,fr); % Coefficients of the filter (help butter)
- Plot the frequency response of the designed filter (see help freqz ).
>> freqz(B,A,N,Fs)
- Filter the DSB-signal (problem 4) in time-domain (see help filter).
>> y=filter(B,A,x_dsb);
- What happened? Compare to the results of part 4.
Download