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 program to generate a Gaussian window and apply it to a signal as...
Write a MATLAB program to generate a Gaussian window and apply it to a signal as follows: 1)Generate a time vector from 0 to 1 seconds with an interval of 0.001 second 2)Generate two sinusoid signals with a frequency of 90 Hz and 100 Hz, respectively, and add them together 3)Generate a Gaussian window and apply it to the combined sinusoid signal 4)Plot an overlay of the original signal and the windowed in the same figure 5)Add a legend to...
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
Write a code to generate a 5 kHz signal using timer. Vary it's duty cycle. Don't...
Write a code to generate a 5 kHz signal using timer. Vary it's duty cycle. Don't use delay function. using any language
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...
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....
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...
Generate the first ten rows of Pascal triangle using MATLAB. Post code in the response
Generate the first ten rows of Pascal triangle using MATLAB. Post code in the response
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
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT