Question
NB! This task is required to be solved in matlab. this task also requires the use of the function displayDualSpectrum();
which i have pasted in the bottom.  the tasks that i need help with are A), B) and C). this is a multi-part question.

Task - Frequency mixing
We use a basic signal that can be described mathematically as follows:  x(t) = A, + Acos (21 fi:t) + A2.cos(21.f2.t)

with this We shall then make an amplitude modulated signal:  y(t) = x(t) · cos(21.fo:t)  where fc is the carrier frequency.  the code below specifies the parameters :

clear;
close all;
%-------------------------------------------------------
% Parameters
%-------------------------------------------------------
Fs = 240; % sampling frequency
F1 = 8;
F2 = 12;
A0 = 0.48;
A1 = 0.31;
A2 = 0.19;
Fc = 50; % Carrier Frequency
T = 20; % signal duration in seconds

A) Complete the code in the field below so that we have two signals in the form of row vectors xt and yt  as described by the formula above. We shall then get a plot of the frequency spectrum into one baseband signal and one frequency modulated signal.

code given by task:

%-------------------------------------------------------
% Signal generation
%-------------------------------------------------------
t = 0:1/Fs:(T-1/Fs); % Gives exactly Fs * T amount of samples.

%-------------------------------------------------------
% Plot of signal spectrum. ( i do not think this one needs to be changed)
%-------------------------------------------------------
subplot(2,1,1);
displayDualSpectrum(xt,Fs);
title('BaseBand-signal x(t)');
subplot(2,1,2);
displayDualSpectrum(yt,Fs);
title('FrequencyMixed signal y(t)');

B)  

Try adjusting the different signal parameters and answer the following control questions:

- Why do we have different amplitudes for the signals in subplot 1 and subplot 2.

- What determines the bandwidth of the signal y(t) ? 

- Try to set the carrier frequency fc to 113 Hz or higher. what happens ?
C) 

Adjust the code and use loops so that the signal x(t) can be given by a variable number of sine components depending on the following formula:

M -1 x(t) = X A;. cos (21.fi.t) i=0

Where the parameters of Ai and fi are given by elements in the row vectors A and F, both with M amounts of elements.

displayDualSpectrum function below:

function displayDualSpectrum(xn,Fs)
L = length(xn);
Xk = fft(xn);
Fk = -Fs/2:Fs/L:(Fs/2-Fs/L);
Xk = [Xk(L/2+1:L) Xk(1:L/2)];

%figure();
%set(gcf, 'Visible', 'on');
  
%plot(Fk, abs(Xk)./(Fs*T), 'LineWidth', 2); axis([max(Fc +F_min,-0.5) (Fc+F_max) 0 (A0+0.02)]);
plot(Fk, abs(Xk)./(L), 'LineWidth', 2);
xlim([-Fs/2 Fs/2]);
xlabel('Frequency (Hz)');
ylabel('Amplitude');
grid on;

end

0 0
Add a comment Improve this question Transcribed image text
Answer #1


Matlab code for Q9 function Q9 clear; close all; %---------- % Parameters 96---- Fs = 240; % sampling frequency f1 = 8; f2 = BaseBand-signal X(t) Amplitude F- 1 - 100 -100 -50 0 50 100 Frequency (Hz) Frequency Mixed signal y(t) Amplitude -100 -50 50

Part b solution figures

part 1

BaseBand-signal X(t) Amplitude F- -100 - 500 Frequency (Hz) 50 100 Frequency Mixed signal y(t) for carrier 2cos(2pifct) Ampli

part b

2)

BaseBand-signal X(t) Amplitude . -100 - 500 Frequency (Hz) 50 100 Frequency Mixed signal y(t) for 12=20 Amplitude -100 -50 50

part b

3)

BaseBand-signal X(t) Amplitude FE -100 50 100 - 500 Frequency (Hz) FrequencyMixed signal y(t) for fc=113 Amplitude 0.1 . .. .% part b % 1) since signal x(t) multiplied by cos(2*pi*fc*t) will translate the spectrum % of x(1) to hihg frequency range saplot of summed signal signal x(t); 0.2 0.4 0.6 0.8 timet

Add a comment
Know the answer?
Add Answer to:
NB! This task is required to be solved in matlab. this task also requires the use...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Below is the MATLAB code of low-cut shelving filter which can cut the low frequency of given music signal and low-boost...

    Below is the MATLAB code of low-cut shelving filter which can cut the low frequency of given music signal and low-boost shelving filter which can boost the low frequency of given music signal. Design your low-boost shelving filter and low-cut shelving filter to have noticeablly different sound. Compare the sounds of two music signals after filtering, and explain the difference in sounds briefly. If there are any mistakes in code, correct them.   Low-cut shelving filter code: close all, clear all,...

  • [MATLAB Scriptfile task] Design N-band tone vocoder with a given figure (below) in MATLAB implementing the...

    [MATLAB Scriptfile task] Design N-band tone vocoder with a given figure (below) in MATLAB implementing the given script file(bands_cutoff). This program should be able to process any sound(.wav) file. Then, graph the band-passed signals and amplitude envelopes extracted(after rectification and low-pass filtering) and waveforms of the original sound and vocoded sound. Additionally, using the output of the script file, make spectrograms of the original sound and the synthesized sound. Bandpass filter Modulation Band-limiting Envelope detection BPF RECT LPF BPF sine...

  • [MATLAB Scriptfile task] Design N-band tone vocoder with a given figure (below) in MATLAB implementing the...

    [MATLAB Scriptfile task] Design N-band tone vocoder with a given figure (below) in MATLAB implementing the given script file(bands_cutoff). This program should be able to process any sound(.wav) file. Then, graph the band-passed signals and amplitude envelopes extracted(after rectification and low-pass filtering) and waveforms of the original sound and vocoded sound. Additionally, using the output of the script file, make spectrograms of the original sound and the synthesized sound. Bandpass filter Modulation Band-limiting Envelope detection BPF RECT LPF BPF sine...

  • I got help with task 1 and 2 . can you help me with task 3 and 4 of this question. please help me...

    I got help with task 1 and 2 . can you help me with task 3 and 4 of this question. please help me step for step thanks. A signal x[n] modulated by multiplying it by a carrier wave cos(2*p1"/cm) to form the signal z[n] = cos(2"p1"Vcm)x[n] ·The modulated signal z[n] multiplies with the same carrier wave to give the signal y[n]=cos(2*pi"Vcm)z[n] and filters with an LT-system to give x-hat [n] . all this are described by the picture below...

  • Part 1: Exponential Fourier series The following MATLAB code calculates the exponential Fourier series coefficient for...

    Part 1: Exponential Fourier series The following MATLAB code calculates the exponential Fourier series coefficient for the signal x(t) shown in the figure below, plots it's double sided amplitude spectrum IDn l, double sided phase spectrem LDn, and the resulting signal xn(t). 4r 4a Periodic signal x(t) 1.1 Show that the complex Fourier Series Coefficients written as: D 1.2 Use the following Matlab to general the two sided spectral line. 1.3 Execute the Matlab code with To = 2π and...

  • Program from problem 1: (Using MATLAB) % Sampling frequency and sampling period fs = 10000; ts...

    Program from problem 1: (Using MATLAB) % Sampling frequency and sampling period fs = 10000; ts = 1/fs; % Number of samples, assume 1000 samples l = 1000; t = 0:1:l-1; t = t.*ts; % Convert the sample index into time for generation and plotting of signal % Frequency and amplitude of the sensor f1 = 110; a1 = 1.0; % Frequency and amplitude of the power grid noise f2 = 60; a2 = 0.7; % Generating the sinusoidal waves...

  • Exercises: u used to the instructor b the end of next lab. 20 102 Plot the f(t)-sinc(20r) cos(300...

    Exercises: u used to the instructor b the end of next lab. 20 102 Plot the f(t)-sinc(20r) cos(300t)sinc (10t) cos(100t) Use the fast Fourier transform to find the magnitude and phase spectrum of the signal and plot over an appropriate range. Use appropriate values for the time interval and the sampling interval. Note that in Matlab sinc(x)-, so we need to divide the argument by n to make it match the given function. Le, sinc(20t/pi) Hint: Use the parameters from...

  • Please explain in detail and use MATLAB code. Thank you. Prob. 4-1 FM and PM are,...

    Please explain in detail and use MATLAB code. Thank you. Prob. 4-1 FM and PM are, respectively, defined as FM: A cos ((t) PM: A cos (kpm(t)) The FM and PM coefficients. kf and kp are kf-100 and kp-2, respectively. The carrier frequency is 400 Hz (1) Plot both the time-domain and frequency-domain representation for two independent message signals, m1(t) and m2(t) using MATLAB. Figure 1 is, again, the illustration of the Rectangular pulse (a) Tn1(t) = 11(t _ 0.5)...

  • Communication system 7- What is the main function of the analog front end (why it is needed and what does it do)? 8- What are the main channel effects? 9- What is the reason for exitance of noise and...

    Communication system 7- What is the main function of the analog front end (why it is needed and what does it do)? 8- What are the main channel effects? 9- What is the reason for exitance of noise and where exactly it happens physically in the system? 10- Draw a block diagram that represents the channel effect. 11- Write an the expression of the received signal, y(t), given that the transmitted signal is x(t), the channel effect is h(t) and...

  • Can you please help me answer Task 2.b? Please show all work. fs=44100; no_pts=8192; t=([0:no_pts-1]')/fs; y1=sin(2...

    Can you please help me answer Task 2.b? Please show all work. fs=44100; no_pts=8192; t=([0:no_pts-1]')/fs; y1=sin(2*pi*1000*t); figure; plot(t,y1); xlabel('t (second)') ylabel('y(t)') axis([0,.004,-1.2,1.2]) % constrain axis so you can actually see the wave sound(y1,fs); % play sound using windows driver. %% % Check the frequency domain signal. fr is the frequency vector and f1 is the magnitude of F{y1}. fr=([0:no_pts-1]')/no_pts*fs; %in Hz fr=fr(1:no_pts/2); % single-sided spectrum f1=abs(fft(y1)); % compute fft f1=f1(1:no_pts/2)/fs; %% % F is the continuous time Fourier. (See derivation...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT