Question: I need MATLAB code for this problem Write a MATLAB function that amplitude modulates a baseband signal and produces a passband signal that is suitable
I need MATLAB code for this problem

Write a MATLAB function that amplitude modulates a baseband signal and produces a passband signal that is suitable for transmission through a speaker.
(a) Your MATLAB function must have the following function signature function sp = ampModulate(ss, fc, BW, modIndex, fc) where
sp - samples of the amplitude modulated signal
ss - (possibly complex) samples of the baseband signal
fc - carrier frequency in Hertz
BW - the bandwidth of the baseband signal
modIndex - the modulation index; if this is infinite (inf) then the carrier is suppressed.
fs - the sampling rate of the system
Your function must perform the following functions:
Verify that fc+BW is less than fs/2. Produce an error message if this condition is violated.
Ensure that the baseband signal is bandlimited to bandwidth BW. Pass the samples ss through a low-pass filter with cut-ff frequency BW to achieve this.
Normalize the filtered signal so that the smallest sample value equals 1. If the baseband signal is complex valued, take the minimum over both real and imaginary part.
Add the carrier so that the specified modulation index is achieved. The carrier is added only to the real (in-phase) part of the signal.
Upconvert the signal to the specified carrier frequency.
(b) Verify that your function works correctly by exercising it with the following signals.
Use a low frequency sinusoid as the baseband signal. Plot the resulting passband signal for different values of the modulation index. Make sure that you choose values of fs that produce plots that you can actually analyze.
Use a speech signal (e.g., the one we used in class) as the baseband signal and compute the spectrum of the passband signal. The MATLAB spectrum function is very helpful for this purpose; it is called like this:
h = spectrum.welch; % Create a spectrum estimator. Hpsd = psd(h,sp,Fs,fs); % Calculate the PSD plot(Hpsd) % Plot the spectrum Ensure that the bandwidth of the passband signal is as expected.
2. Write a MATLAB function that amplitude modulates a basebanod signal and produces a passband signal that is suitable for "trans- (a) Your MATLAB function must have the following function sig- function sp - ampModulate(ss, fc, BW, modIndex, fc) mission" through a speaker nature where sp samples of the amplitude modulated signal . ss - (possibly complex) samples of the baseband signal fc-carrier frequency in Hertz BW the bandwidth of the baseband signal . modIndex - the modulation index; if this is infinite (inf) then the carrier is suppressed . fs - the sampling rate of the system Your function must pertorm the following functions: . Verify that fc+BW is less than fs/2. Produce an error message if this condition is violated Ensure that the baseband signal is bandlimited to band- width BW. Pass the samples ss through a low-pass filter with cut-ff frequency BW to achieve this . Normalize the filtered signal so that the smallest sample value equals -1. If the baseband signal is complex valued, take the minimum over both real and imaginary part . Add the carrier so that the specified modulation index is achieved. The carrier is added only to the real (in-phase) part of the signal Upconvert the signal to the specified carrier frequency (b) Verify that your function works correctly by exercising it with the following signal:s Use a low frequency sinusoid as the baseband signal. Plot the resulting passband signal for different values of the modulation index. Make sure that you choose values of fs that produce plots that you can actually analyze . Use a speech signal (e.g., the one we used in class) as the baseband signal and compute the spectrum of the pass- band signal. The MATLAB spectrum function is very helpful for this purpose; it is called like this h spectrum. welch; % Create a spectrum estimator. Epsd = psd (h , sp ,,Fs, ,fs); % Calculate the PSD plot (Hpsd) % Plot the spectrum Ensure that the bandwidth of the passband signal is as expected 2. Write a MATLAB function that amplitude modulates a basebanod signal and produces a passband signal that is suitable for "trans- (a) Your MATLAB function must have the following function sig- function sp - ampModulate(ss, fc, BW, modIndex, fc) mission" through a speaker nature where sp samples of the amplitude modulated signal . ss - (possibly complex) samples of the baseband signal fc-carrier frequency in Hertz BW the bandwidth of the baseband signal . modIndex - the modulation index; if this is infinite (inf) then the carrier is suppressed . fs - the sampling rate of the system Your function must pertorm the following functions: . Verify that fc+BW is less than fs/2. Produce an error message if this condition is violated Ensure that the baseband signal is bandlimited to band- width BW. Pass the samples ss through a low-pass filter with cut-ff frequency BW to achieve this . Normalize the filtered signal so that the smallest sample value equals -1. If the baseband signal is complex valued, take the minimum over both real and imaginary part . Add the carrier so that the specified modulation index is achieved. The carrier is added only to the real (in-phase) part of the signal Upconvert the signal to the specified carrier frequency (b) Verify that your function works correctly by exercising it with the following signal:s Use a low frequency sinusoid as the baseband signal. Plot the resulting passband signal for different values of the modulation index. Make sure that you choose values of fs that produce plots that you can actually analyze . Use a speech signal (e.g., the one we used in class) as the baseband signal and compute the spectrum of the pass- band signal. The MATLAB spectrum function is very helpful for this purpose; it is called like this h spectrum. welch; % Create a spectrum estimator. Epsd = psd (h , sp ,,Fs, ,fs); % Calculate the PSD plot (Hpsd) % Plot the spectrum Ensure that the bandwidth of the passband signal is as expected
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
