 # Basic Signal Processing Project: Matlab Code

Subject Engineering Electrical Engineering

## Question

1. A stereo FM signal is assembled and disassembled by the signal processing flow shown below (image) with the spectrum indicated.

A. Form a Left signal by a set of equal amplitude, equally spaced tones of 5, 10, and 15 kHz. The tones have random phase and duration 0.1 seconds. Show 500 samples of the time response and the windowed and scaled spectrum of this signal.
B. Form a Right signal by a set of equal amplitude, equally spaced tones matching 0.5* the counting index your three initials in kHz (f j h => 0.5*(6 10 8) => (3 5 4) kHz). These tones also have random phase and duration 0.1 seconds. Show 500 samples of the time response and the windowed and scaled spectrum of this signal.
C. Assemble the composite stereo signal as indicated in the figure above. Set the amplitude of the 19-kHz pilot to half that of the signal tones and scale the composite signal for maximum amplitude of 1.0. Show 500 samples of the time response and the windowed and scaled spectrum of this signal.
D. Use the Remez algorithm to design a FIR filter meeting the specifications of the two low pass filters in the receiver. The in band ripple is be less than 0.1 dB and the out-of band attenuation is to be greater than 60 dB. Show the pole-zero diagram and the time response and the windowed and scaled spectrum of the filter.
E. Use the Remez algorithm to design a FIR filter meeting the specifications of the band pass filter in the receiver. Design this filter as a low pass and then heterodyne its response to 19 kHz. Assume the two-sided, 1 dB pass band bandwidth is 100 Hz and the filter must attenuate the adjacent spectral terms by 60 dB. Show the pole-zero diagram and the time response and the windowed and scaled spectrum of the band pass filter.
F. In order to demodulate the composite signal, the phase of the input and output of the 19 kHz tone processed by the band pass filter must be phase aligned within 3 degrees. This may require additional delay to accomplish this alignment or an appropriate phase shift in the 19 kHz heterodyne. Show the mechanism you employed to meet this requirement. Form plots of the input and output time responses to show that the filter meets this requirement. You can also demonstrate this by plotting the complex spectra of the input and output time series. Do this too.
G. Use the two filters designed in D and E above to demodulate the composite stereo signal. Show 500 samples of the time response and the windowed and sealed spectrum of the two demodulated signals.
H. Design the low pass filter as a recursive inverse Tchebyshev filter. Show the Show the pole-zero diagram and the time response and the windowed and scaled spectrum of the filter.
I. Design the band pass filter as a recursive inverse Tchebyshev filter. Show the Show the pole-zero diagram and the time response and the windowed and scaled spectrum of the band pass filter.
J. Form plots of the input and output time responses to show that the recursive band pass filter with appropriate additional delay meets the 19- kHz phase alignment requirement. You can also demonstrate this by plotting the complex spectra of the input and output time series. Do this too.
K. Use the two filters designed in H and I above to demodulate the composite stereo signal. Show 500 samples of the time response and the windowed and scaled spectrum of the two demodulated signals.
L. Compare and comment on the computational complexity of the two filters sets, (FIR and the HR).

2. Here we examine the effect of finite precision coefficients with the low—pass filter designed in 1.13 above.
A. Without coefficient sealing, quantize the filter coefficients to 12 bits [h_q=fioor(2"12*h)/(2"I2)]. Plot the quantization error (difference between input and output of the quantizer. Show the frequency response of the quantized and non-quantized coefficient set. Comment on the out-of-band side lobe levels.
B. With coefficient scaling to unity peak gain, quantize the filter coefficients to 12 bits [h_q=floor(2"12*h)/(2"12)]. Plot the quantization error (difference between input and output of the quantizer. Show the frequency response of the quantized and non-quantized coefficient set. Comment on the out-of-band side lobe levels.

3. Here we examine the use of windows in spectral analysis.
A. Form a sampled data signal composed of three real sinusoids with frequencies matching your 3 initials (A=1, B=2...) in kHz with sample rate 100 k. The sinusoids have random phase, amplitudes equal to 0.001, and duration of 100 mini-seconds. A sinusoid of amplitude 1.0 and of frequency 0.9*the lowest frequency is added to your initials frequency. Show 500 samples of the initial time series and of the summed time series. Can you see the low level signals in the summed time series?
B. Show the time response and zoomed to main lobe spectra for the window identified below. For ease of comparison, use same scale for all plots and scale all spectra to the main lobe peaks.
C. Show the windowed and scaled spectrum of your time series for series of length 1000 and of length 10000 for the following windows:
i) Rectangle
ii) Hann
iii) Hamming
iv) Kaiser (N, 6)
v) Kaiser(N,10)
Comment on the effect of the window length and window shape on you ability to resolve the spectral lines. ## Solution Preview

This material may consist of step-by-step explanations on how to solve a problem or examples of proper writing, including the use of citations, references, bibliographies, and formatting. This material is made available for the sole purpose of studying and learning - misuse is strictly forbidden.

%% 1.

% A. Left signal
fs = 152000; % sampling frequency (seen from the image)
t = [0:1/fs:0.1];
f1 = 5000; f2 = 10000; f3 = 15000; % expressed in Hz
phaseL = mod(randn(1,1),2*pi);
L = sin(2*pi*f1*t + phaseL) + sin(2*pi*f2*t + phaseL) + sin(2*pi*f3*phaseL);
figure, plot(t(1:500), L(1:500))
LFFT = abs(fft(L)/length(L)); % spectrum
plot(LFFT)

% B. Right signal
t = [0:1/fs:0.1];
phaseR = mod(randn(1,1),2*pi);
R = sin(pi*f1*t + phaseR) + sin(pi*f2*t + phaseR) + sin(pi*f3*t + phaseR);
figure, plot(t(1:500), R(1:500))...

This is only a preview of the solution. Please use the purchase button to see the entire solution

## Related Homework Solutions

Electronics Op Amp Configurations and Gain \$25.00
Op Amp
Operational Amplifier
Electronics
Gain
Decibel
dB
Transfer Function
Complex Function
Voltage
Phase
Electronic Technician Knowledge Questions \$28.00
Electronics
Digital Electronics
Analog Electronics
Transistor
Resistance
Capacitor
Power Supply
Circuit Analysis \$38.00
Circuit
Analysis
Electrical
Engineering
Thevenin
Norton
Superposition
Simulation
Voltage
Current
A Report on a Temperature Control Subsystem for Heated Mug \$35.00
Temperature
Control
Subsystem
Heated
Mug
Electrical
Engineering
Operating
Environment
Reliability
Electrical Circuit and Device \$60.00
Electrical
Circuit
Device
Engineering
Voltage
Current
Power
Resistor
Phasor
Impedance