Question

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 n

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

fs=1000;
n=1000;
t=0:1/fs:(n-1)/fs;
f1=60;
f2=150;
v = 4; % variance
sigma = sqrt(v); % standard deviation
mu = 0; % mean
y = sigma .* randn(1, n) + mu;
figure(2)
plot(t,y)
x=0.8*sin(2*pi*f1*t)+1.2*sin(2*pi*f2*t);
z=x+y;
zfft=fft(z,n);
z_mag=2*fftshift(abs(zfft))/n;
df=-fs/2:1:fs/2;
figure(3)
plot(df(fs/2:fs),z_mag(fs/2:fs));
xlim([0 fs/2])

Add a comment
Know the answer?
Add Answer to:
Write a MATLAB code for the question below. There is an initial signal containing 60 Hz...
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
  • 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...

  • (B) Implement Matlab code for each part as described below: i) Define the following signal in tim...

    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...

  • 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...

    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. Sketch the Fourier transform of the signal with appropriately generating frequency axis. Apply an appropriate filter to y(t) so that signal part with frequency f1 can be extracted. Sketch the Fourier transform of the extracted signal. Apply an appropriate filter to y(t) so that signal part with frequency f2 can be extracted. Sketch the Fourier...

  • 3) Develop Matlab code to plots of chirp signal and its FFT (sampling frequency-500 Hz, duration:...

    3) Develop Matlab code to plots of chirp signal and its FFT (sampling frequency-500 Hz, duration: 1 second, length of FFT 1024). Explain what chirp signal is and how it is using in industry 3) Develop Matlab code to plots of chirp signal and its FFT (sampling frequency-500 Hz, duration: 1 second, length of FFT 1024). Explain what chirp signal is and how it is using in industry

  • Need MatLab code Exercise: Use MATLAB to generate the sinusoidal waveform: x(t) = 3 cos(1200) Consider...

    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)...

  • Now use MATLAB to generate and plot 15seconds of this signal in the time-domain.Use the fft()...

    Now use MATLAB to generate and plot 15seconds of this signal in the time-domain.Use the fft() function to find the fourier transform of this signal and plot its magnitude spectrum School of Engineering Task 3 - The Fourier Transform: Scaling property Exercise: Let's take a look now at using the Fourier transform on aperiodic signals. Consider the real exponential signal from the discharging capacitor in tas 3 of laboratory 1 which was found to be: You(t)=e"u(t) Begin by calculating manually...

  • consider the signal using matlab Problem 2: Consider a signal: x[n] 3cos(n7/3) + 2sin(nt/4)+ cos(n7/5) Using...

    consider the signal using matlab Problem 2: Consider a signal: x[n] 3cos(n7/3) + 2sin(nt/4)+ cos(n7/5) Using Matlab, (1) Plot this signal in time domain. Can you identify the various frequencies in this signal? Use n 0:1:1000 (2) Plot this signal in frequency domain using the "fft" command. Identify the individual frequencies in the plot. (3) Calculate the frequencies of these signals. In the frequency plot, 1000 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...

    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...

  • Reproduce Figures 9.2b and 9.2c on MATLAB, assuming that the square wave (Figure 9.2b) is a...

    Reproduce Figures 9.2b and 9.2c on MATLAB, assuming that the square wave (Figure 9.2b) is a periodic symmetric square wave of normalized amplitude (A=1). Each student group should decide the power spectral density level of the channel noise. Compute the Fourier transform of the periodic square wave. clear all close all %%%% T=12*pi; %number of period x=linspace(0,T); t=x/pi y0=square(x); %square wave signal y0ft=fft(y0); %calculating Fourier Transformof signal y0fts=fftshift(y0ft); y0ftFinal=abs(y0ft); AWGN= rand(size(x)); %Calculating whit noise Att=(1/3); nSig= Att*AWGN; y=y0+nSig; %Square wave...

  • 3) Given three sinusoids with the following amplitude and phases (t)-Scos(2x (1200+0.25x) a. Create a MATLAB...

    3) Given three sinusoids with the following amplitude and phases (t)-Scos(2x (1200+0.25x) a. Create a MATLAB program to sample each sinusoid and generate a sum of three sinusoids, that is, х(n)=x1(nHx:(n)+xy(n), using a sampling rate of 8000 Hz, and plot the sum x(n) over a range of time that will exhibit approximately 0.1 second. (10 pts) b. Use the MATLAB function fO to compute DFT coefficients, and plot and examine the spectrum of the signal x(n).(10 pts Write a MATLAB...

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