Write a Matlab code to generate the signal y(t)=10*(cos(2*pi*f1*t)+ cos(2*pi*f2*t)+ cos(2*pi*f3*t)), where f1=500 Hz, f2=750 Hz and f3=1000 Hz. Plot the signal in time domain.
MATLAB Code to plot the signal in time domain
clc;
clear all;
close all;
f1 = 500;
f2 = 750;
f3 = 1000;
t = 0:0.0000001:0.05;
y = 10*(cos(2*pi*f1*t) + cos(2*pi*f2*t) + cos(2*pi*f3*t));
plot(t,y);
grid on;
xlabel('Time, t(s)');
ylabel('y(t)');
title('Plot of the signal y(t)');
After running the code, we get the following plot

To sketch the Fourier Transform of the Signal
MATLAB Code
clc;
clear all;
close all;
f1 = 500;
f2 = 750;
f3 = 1000;
fs = 3*f3;
Ts = 1/fs;
n = 0:1000;
y = 10*(cos(2*pi*f1*n*Ts) + cos(2*pi*f2*n*Ts) +
cos(2*pi*f3*n*Ts));
w = 0:pi/100000:pi;
Y = y*exp(-j*n'*w);
figure
plot(w/(2*pi)*fs,abs(Y));
grid on;
xlabel('Frequecny, f (Hz)');
ylabel('|Y(\Omega)|');
title('Magnitude Spectrum of the input Signal');
After running the code we get the output as

To extract the frequency f1
We have to use a low pass filter with a cut off frequency greater than 500Hz. So I am using 600 Hz. I am using a Butterworth filter with an order of 31
MATLAB Code
clc;
clear all;
close all;
f1 = 500;
f2 = 750;
f3 = 1000;
fs = 3*f3;
Ts = 1/fs;
n = 0:1000;
y = 10*(cos(2*pi*f1*n*Ts) + cos(2*pi*f2*n*Ts) +
cos(2*pi*f3*n*Ts));
w = 0:pi/100000:pi;
[b,a] = butter(31,2*600/fs); % Butterworth Low Pass filter of
order 31 and cut off frequency of 600 Hz
yout = filter(b,a,y);
w = 0:pi/100000:pi;
Yout = yout*exp(-j*n'*w);
figure
plot(w/(2*pi)*fs,abs(Yout));
grid on;
xlabel('Frequecny, f (Hz)');
ylabel('|Y_{0ut}(\Omega)|');
title('Magnitude Spectrum of the output Signal');
The result obtained

From the frequency response plot we can see that the signal with frequency 500 Hz is extracted
To extract the frequency f2
We have to use a band pass filter with a cut off frequency greater than 500Hz and less than 1000Hz.. So I am using 600 Hz and 900 Hz as the cut off frequencies. I am using a Butterworth filter with an order of 31
MATLAB Code
clc;
clear all;
close all;
f1 = 500;
f2 = 750;
f3 = 1000;
fs = 3*f3;
Ts = 1/fs;
n = 0:1000;
y = 10*(cos(2*pi*f1*n*Ts) + cos(2*pi*f2*n*Ts) +
cos(2*pi*f3*n*Ts));
w = 0:pi/100000:pi;
[b,a] = butter(31,[2*600/fs 2*900/fs], 'bandpass'); %
Butterworth Band Pass filter, Order 31 & cut off frequency 600
& 900Hz
yout = filter(b,a,y);
w = 0:pi/100000:pi;
Yout = yout*exp(-j*n'*w);
figure
plot(w/(2*pi)*fs,abs(Yout));
grid on;
xlabel('Frequecny, f (Hz)');
ylabel('|Y_{0ut}(\Omega)|');
title('Magnitude Spectrum of the output Signal');
The result obtained

From the frequency response plot we can see that the signal with frequency 750 Hz is extracted
To extract the frequency f3
We have to use a high pass filter with a cut off frequency greater than 750Hz and less than 1000Hz. So I am using 900 Hz. I am using a Butterworth filter with an order of 31
MATLAB Code
clc;
clear all;
close all;
f1 = 500;
f2 = 750;
f3 = 1000;
fs = 3*f3;
Ts = 1/fs;
n = 0:1000;
y = 10*(cos(2*pi*f1*n*Ts) + cos(2*pi*f2*n*Ts) +
cos(2*pi*f3*n*Ts));
w = 0:pi/100000:pi;
[b,a] = butter(31, 2*900/fs, 'high'); % Butterworth High Pass
filter of order 31 and cut off frequency of 900 Hz
yout = filter(b,a,y);
w = 0:pi/100000:pi;
Yout = yout*exp(-j*n'*w);
figure
plot(w/(2*pi)*fs,abs(Yout));
grid on;
xlabel('Frequecny, f (Hz)');
ylabel('|Y_{0ut}(\Omega)|');
title('Magnitude Spectrum of the output Signal');
The result obtained

From the frequency response plot we can see that the signal with frequency 1000 Hz is extracted
Write a Matlab code to generate the signal y(t)=10*(cos(2*pi*f1*t)+ cos(2*pi*f2*t)+ cos(2*pi*f3*t)), where f1=500 Hz, f2=750 Hz...
1. Create the following signals, f1, f2 in time domain. t = 0 to 1 second. f1(t) = 8 sin (2 *pi*80*t); f2(t) = 4 cos (2*pi*240*t) Define any assumptions you make to generate the signals. 2. Plot the two graphs as sub plots with appropriate lables in x axis (time), y axis, title etc. 3. Generate the following signal f3 = f1 + f2; 4. Plot as sub plot in (2). 5. Compute the fourier transform of this signal,...
Write a MATLAB code for the question below.
There is an initial signal containing 60 Hz sinusoid of amplitude 0.8 and a 150 Hz sinusoid of amplitude 1.2 corrupted by a noise - using the randn command - (zero-mean white noise with variance of 4). Plot the noisy signal in the time domain. After that compute the Fourier transform -using the fft command of the noisy signal, compute the two-sided spectrum. Define the frequency domain f and plot the single-sided...
Write Matlab Code Only Generate a multi-tone sinusoidal signal with f1=2000Hz and f2=4000Hz, then by sampling generate the Oversampled and Undersampled version of it and display the frequency response also.
Use MATLAB to generate code for this 4.Given the following functions: (1) f1 (x, y) = cos (3 x); (2) f2 (x, y) = cos (5 y); (3) f3 (x, y) = cos (3 x) cos (5 y); Please plot 3D plots/images for each of the functions. Please show your steps/ derivations to explain why you obtain those plots/figures.
Need MatLab code
Exercise: Use MATLAB to generate the sinusoidal waveform: x(t) = 3 cos(1200) Consider the frequency of this sinusoid and use this information to select an appropriate time-step and time array that will allow this signal to be correctly represented and displayed on a new MATLAB figure window (display 4 periods of this wave only). Now set up an appropriate frequency array and use the fft() and fftshift() functions to generate and plot the Fourier Transform (magnitude spectra)...
Please finish these questions. Thank you
Given find the Fourier transform of the following: (a) e dt 2T(2 1) 4 cos (2t) (Using properties of Fourier Transform to find) a) Suppose a signal m(t) is given by m()-1+sin(2 fm) where fm-10 Hz. Sketch the signal m(t) in time domain b) Find the Fourier transform M(jo) of m(t) and sketch the magnitude of M(jo) c) If m(t) is amplitude modulated with a carrier signal by x(t)-m(t)cos(27r f,1) (where fe-1000 Hz), sketch...
Hello, I have questions on Matlab. Let's say that I have an equation. Signal x(t)= cos(2*pi*10*t) is sampled at sampling frequency of Fs=100 Hz. How do I both Upsample and downsample this frequency by a factor of 2 in Matlab? I need to see the code and how the graphs look. Thank you for the help.
Using MATLAB, Please read carefully, EXPLAIN CODE AND ANSWERS,
DISCUSS RESULTS, I NEED EVERY PART
(B) Implement Matlab code for each part as described below: i) Define the following signal in time and plot it where Ai 10, A2-3, fi-10 Hz, f2-40 Hz. part of the DFT, and discuss the results. zero. Do this carefully for both positive and negative frequencies. Call this signal G (f). ii) Compute the DFT S(f) of s (t) using the fft() function. Plot the...
An information signal is of the form s(t) = sin(2*pi*t)/t. The signal amplitude modulates a carrier of frequency 10Hz. Find and sketch the Waveform and Fourier transform of the transmitted signal before and after AM modulation. For AM modulation you can consider the simple case of DSB format (or double-sideband suppressed carrier modulation).
need matlab code
Exercise: Use MATLAB to generate a low frequency signal: xy(t) = 3 cos(1400) And a higher frequency signal: xz(t) = 2 cos(10,000st) Now add these two signals together to generate the dual-component signal: y(t) = 3 cos(14007a)+ 2 cos(10,000) Points to be addressed: Again, manually calculate the theoretical magnitude spectra of y(t) and show this in your report (use Microsoft Visio or similar for your diagram). Clearly label all axes! Contrast this working to what you see...