Question

In: Electrical Engineering

Using Matlab, write code to generate Three signal components We will use a sum of sinusoids,...

Using Matlab, write code to generate Three signal components

  • We will use a sum of sinusoids, all of which are sampled at 10 kHz.
  • Signal 1 should contain a sum of sinusoids with frequencies at 25Hz, 40Hz and 75Hz.
  • Signal 2 should contain a sum of sinusoids with frequencies at 600Hz, 730Hz, and 800Hz.
  • Signal 3 should contain a sum of sinusoids with frequencies at 3500Hz, 4000Hz, and 4200Hz.
  • Choose a variety of amplitudes and phase shifts for the sinusoids.
  • Plot 500-points time waveform of signal 1, signal 2 and signal 3.

Solutions

Expert Solution

Hello,
Please find the answer attached below. If the answer has helped you please give a thumbs up rating. Thank you and have a nice day!

*********** Matlab Code **********


fs = 10000;
Ts = 1/fs;
t = 0:Ts:499*Ts; % 500 points for time
x1 = sin(2*pi*25*t) + 2*sin(2*pi*40*t+0.8) + 1.5*sin(2*pi*75*t);
x2 = 2.5*sin(2*pi*600*t + 1.5) + sin(2*pi*730*t) + 1.5*sin(2*pi*800*t);
x3 = 0.8*sin(2*pi*3500*t) + sin(2*pi*4000*t) + 1.5*sin(2*pi*4200*t);
%% plotting
subplot(3,1,1);
plot(t,x1,'LineWidth',2);
grid;
xlabel('Time(s)');
ylabel('Amplitude');
title('X1');

subplot(3,1,2);
plot(t,x2,'LineWidth',2);
grid;
xlabel('Time(s)');
ylabel('Amplitude');
title('X2');

subplot(3,1,3);
plot(t,x3,'LineWidth',2);
grid;
xlabel('Time(s)');
ylabel('Amplitude');
title('X3');


********** Output **********

*************************************************************
PS: Please do not forget the thumbs up!!


Related Solutions

Write a matlab code for given task Use your ‘sin’ or ‘cos’ function to generate a...
Write a matlab code for given task Use your ‘sin’ or ‘cos’ function to generate a sinusoid wave having two components as f1 = 3kHz and f2 = 5kHz and then sample it with fs = 10kHz. Calculate its fft with zero frequency component in the middle. Plot it on a properly scaled w-axis. Specify if there is aliasing or not? If there is aliasing specify which component is casing the aliasing
a – DSB. Write the code for an m-file (script) to generate a DSB signal. The...
a – DSB. Write the code for an m-file (script) to generate a DSB signal. The modulating (message) signal is a single tone signal with frequency 1kHz and the carrier frequency is 30kHz. Time Vector: 3001 points over range from 0 to 3ms (3 cycles of the modulating signal). Plot your original message signal both in time and its spectrum. (Note: the Matlab examples 6.1 and 6.2 will help, but use the cosine functions for your signals instead of sine...
Using MATLAB or Octave, use documenting code to Write a script that prompts the user for...
Using MATLAB or Octave, use documenting code to Write a script that prompts the user for a minimum and maximum real number, then generates and prints a random number in the requested range. The script should then do the same for an integer range. Sample output: Enter a minimum real value: 0.5 Enter a maximum real value: 30 A random number in the range ( 0.5000, 30.0000 ) is 1.7851 Enter a minimum integer value: -10 Enter a maximum integer...
DSB: Write the code for an m-file (script) to generate a DSB signal. The modulating (message)...
DSB: Write the code for an m-file (script) to generate a DSB signal. The modulating (message) signal is a single tone signal with frequency 1kHz and the carrier frequency is 30kHz. Time Vector: 3001 points over range from 0 to 3ms (3 cycles of the modulating signal). Plot your original message signal both in time and its spectrum. (Note: use the cosine functions for your signals). In your report you should include the plots for the modulated signal in time...
The language is MATLAB Write a function that will generate three random integers, each in the...
The language is MATLAB Write a function that will generate three random integers, each in the inclusive range from 10 to 80. It will then return a string consisting of the three integers joined together, and also a character vector consisting of the three integers joined together. For example, if the random integers are 11, 29, and 76, the string that is returned will be "112976" and the character vector that is returned will be '112976'. I'm really confused on...
Write a Matlab code for PSK modulation of Polar signal full widht rectangular pulses and data...
Write a Matlab code for PSK modulation of Polar signal full widht rectangular pulses and data rate 1 mbit/s also find PSD of psk and estimate Bandwidth
Use and provide Matlab for the following: Generate the discrete-time signal x[n] = 4 cos (2pi....
Use and provide Matlab for the following: Generate the discrete-time signal x[n] = 4 cos (2pi. 10. nT5) + 2cos(2pi. 100. nT5) + 3cos(2pi 200. nT's), with Ts0.001 sec. Display the signal in both time and frequency-domain. Assume that the 100 Hz component of x [n] is your desired signal while the other two components are noise. Design a suitable filter to extract the desired (i.e. 100 Hz) signal. Display the filter's response. Display the output signal in the frequency-domain....
Use Matlab to write the following 1. Write code to determine whether a year is a...
Use Matlab to write the following 1. Write code to determine whether a year is a leap year. Use the mod function. The rules for determining leap years in the Gregorian calendar are as follows: All years evenly divisible by 400 are leap years. Years evenly divisible by 100, but not by 400, are not leap years. Years divisible by 4, but not by 100, are leap years. All other years are not leap years. For example, the years 1800,...
Write the R code to generate five independent uniform random numbers and use that to generate...
Write the R code to generate five independent uniform random numbers and use that to generate 5 independent Bernoulli random variables with probability of success p = 0.4. please use RStudio. please do not use lab nor rbern for calculations.
Need explanation of MATLAB code which creates echo. (SIGNAL PROCESSING) If the original audio signal is...
Need explanation of MATLAB code which creates echo. (SIGNAL PROCESSING) If the original audio signal is x(t) then the echo is y(t) = x(t) + alpha*x(t-delay) This code below creates this echo however I don't understand how every line of the code works, could someone comment this code so I can understand? [x,Fs] = audioread('Hallelujah.wav'); sound(x,Fs); delay = 0.5; % 0.5s delay alpha = 0.65; % echo strength D = delay*Fs; y = zeros(size(x)); y(1:D) = x(1:D); for i=D+1:length(x) y(i)...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT