Question

Wave Packets (a) Create a wave by adding two different waves by using Matlab, but different...

Wave Packets

(a) Create a wave by adding two different waves by using Matlab, but different combination than those we used in the class. Paste the output graph (and also the code). Any two waves can be chosen, but explain the difference compared to the original wave packet we obtained in the class. You can modify the code I used in the class, or build something from scratch.

(b) Add as much waves as you want (minimum:3), using Matlab. Explain your result in some way.

the weaves that we used in class:

>> % Wave packets

lambda1=9;lambda2=11;
v1=6;v2=4;
k1=2*pi/lambda1;k2=2*pi/lambda2;
omega1=6*k1;omega2=4*k2;

delomega=omega1-omega2

x=linspace(-70,70,1000);
t=linspace(0,1,100);

for n=1:length(t)
y1(:,n)=cos(k1.*x-omega1.*t(n));
y2(:,n)=cos(k2.*x-omega2.*t(n));
ysum(:,n)=y1(:,n)+y2(:,n);
end

figure(1)
hold on
ylim([-8 4])
plot(x,ysum(:,1),'-.k')
plot(x,ysum(:,33),'r') %t=0.33
xline(0)
xline(5,'r')
xline(2,'--b')
plot(x,y1(:,1)-5,'-.k')
plot(x,y1(:,33)-5,'b') %t=0.33

figure(2)
hold on
ylim([-8 4])
plot(x,ysum(:,1),'-.k')
plot(x,ysum(:,100),'r') %t=1
xline(0)
xline(15,'r')
xline(6,'--b')
plot(x,y1(:,1)-5,'-.k')
plot(x,y1(:,100)-5,'b') %t=1

delomega =

1.9040


ans =

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

ANS:

The question is answered below.

Dear Friend,

malab code is provided below. I am also attaching the output graphs also. since the combination you have used in your class is not given, i am taking general and simple waveforms which are easy to understand by you. if you want other waveforms to be used , then just replace x1 and x2 with your waveforms.

MATLAB CODE:-

t=0:.00001:.1;
f1=100;
f2=200;
x1=sin(2*pi*f1*t);
x2=cos(2*pi*f2*t+90);
y=x1+x2;
subplot(311)
plot(t,x1);
subplot(312)
plot(t,x2);
subplot(313)
plot(t,y);

NOTE:Please upvote.

Add a comment
Know the answer?
Add Answer to:
Wave Packets (a) Create a wave by adding two different waves by using Matlab, but different...
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
  • I wrote a Matlab program for the figure below. When I plot the waves, they look...

    I wrote a Matlab program for the figure below. When I plot the waves, they look the same. Why do the two waves frequencies look same and How do I avoid it? (I really do need this part of the question answered.) N = 200; % Total number of time domain samples in simulation. Fs = 100 ;% sampling frequency. F1 = 10; % frequency of wave - 1. F2 = 90; % frequency of wave - 2. phi =...

  • Hello. I need help modifying this MatLab code. This is a basic slider-crank animation. the current...

    Hello. I need help modifying this MatLab code. This is a basic slider-crank animation. the current program stops the animation and then has the crank move backward. I need the crank to instead to move in full 360 degrees circular motion. Exactly like how a slide-crank mechanism works in real life. thank you and here is the code. %%Code Begins Here%% L1=0.2; L2=0.45; W=0.5; tt=linspace(0,15); for i=1:length(tt)     x2=@(t) L2+L1*sin(W*t);     y2=0;     X2=x2(tt(i));     Y2=y2;     sol= fsolve(@(x,x2,y2) root2d(x,X2,Y2),...

  • The following two waves are sent in opposite directions on a horizontal string so as to create a standing wave in a ver...

    The following two waves are sent in opposite directions on a horizontal string so as to create a standing wave in a vertical plane y1(x, t) = (6.30 mm) sin(6.50TX . 420 Y2(x, t) (6.30 mm) sin(650TX + 42urt), with x in meters and t in seconds. An anitinode is located at point A. In the time interval that point takes to move from maximum upward displacement to maximum downward displacement, how far does each wave move along the string?...

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

  • A standing wave results from the sum of two transverse traveling waves given by y1 =...

    A standing wave results from the sum of two transverse traveling waves given by y1 = ymcos(kx - ωt) and y2 = ymcos(kx + ωt) where ym = 0.047 m, k = 3.2 rad/m, and ω = 12 rad/s. (a) What is the smallest positive value of x that corresponds to a node? Beginning at t = 0, what is the value of the (b) first, (c) second, and (d) third time the particle at x = 0 has zero...

  • A standing wave results from the sum of two transverse traveling waves given by y1 =...

    A standing wave results from the sum of two transverse traveling waves given by y1 = ymcos(kx - ωt) and y2 = ymcos(kx + ωt) where ym = 0.057 m, k = 4.4 rad/m, and ω = 13 rad/s. (a) What is the smallest positive value of x that corresponds to a node? Beginning at t = 0, what is the value of the (b) first, (c) second, and (d) third time the particle at x = 0 has zero...

  • N MATLAB: This is an easy problem to demonstrate how polyfit and polyval work! The values...

    N MATLAB: This is an easy problem to demonstrate how polyfit and polyval work! The values in y are basically a sine function on x. You can validate by checking in MATLAB >> x = 0:9 x = 0 1 2 3 4 5 6 7 8 9 >> y = sin(x) y = 0 0.8415 0.9093 0.1411 -0.7568 -0.9589 -0.2794 0.6570 0.9894 0.4121 Now, let us try to see what happens if we use polyfit on the values of...

  • function [Rx] = matrixTransform(R) % MOD10TRANSFORM is a function which will visualise the effect of your...

    function [Rx] = matrixTransform(R) % MOD10TRANSFORM is a function which will visualise the effect of your % 2-by-2 transformation matrix R on a set of grid points. It will also plot % the eigenvectors of the matrix R if there are two real eigenvectors. close all; minX = -10; maxX = 10; minY = -10; maxY = 10; n = 10; pad = 5; corners = [minX, maxX, minX, maxX; maxY, maxY, minY, minY]; corners = [corners, R*corners]; corners =...

  • I need help in MATLAB. I'm working on a circuits lab report and I want to...

    I need help in MATLAB. I'm working on a circuits lab report and I want to plot the derivative of an input signal. The circuit is a differentiator OpAmp. It is receiving a triangle wave as an input and should output a square wave. (I've included my existing code.) The output formula is: Vout = -(Rf)*C*(dVin/dt) Where Rf is feedback resistance: Rf = 1*10^6; and C = 1*10^-6. EXISTING CODE: %% This section is copied, and then modified from another...

  • How can I get my while loop to run until my condition in my if statement...

    How can I get my while loop to run until my condition in my if statement is met? (In MATLAB) clc%clears screen clear all%clears history close all%closes all files format long %Euler's Method %Initial conditions and setup %Projectile motion x=3;%randi(3); y=3;%randi(3); figure('color','white'); plot(x,y,'bo'); hold on wind = (-10 + 20*rand(1)); fprintf('The wind speed is %2.2i\n',wind); v0= input('Initial velocity(m/s): '); a= input('Angle of projection(in degrees): '); a=a*pi/180; h=.01; cd=.1; %cdy=.1; %cdx=(rand*2-1)/2; %cdy=(rand*2-1)/2; m=1.5; g=9.8; %acceleration due to gravity in m/s^2 %td=2*v0*sin(a)/g;...

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