{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Em350hw2 - A.1 1 MATLAB CODE"spectrum function function[V =...

Info icon This preview shows pages 1–5. Sign up to view the full content.

View Full Document Right Arrow Icon
0 1 2 3 4 5 6 7 8 9 10 0 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0.45 0.5 A.1 Ryan Finke 1) MATLAB CODE em 350 HW 2 “spectrum function” function [V] = spectrum1(f,fc,bw); A = sqrt(log(2))/(pi*bw); V = A*sqrt(pi)*(exp(-(4*pi^2*A^2*(f-fc)).^2)); “M-file – Plot one part” fc = 5; %MHz bw = 1; %MHz f = s_space(0,100,512); %MHz V = spectrum1(f,fc,bw); figure(1); plot(f, V) axis([0 10 0 0.5]) 1b) MATLAB CODE “M-file – Plot v(t) using IFourierT and compair”
Image of page 1

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
-3 -2 -1 0 1 2 3 -1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1 -3 -2 -1 0 1 2 3 -1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1 dt=1/100; t = s_space(0, 512*dt, 512); v = IFourierT(V,dt); vshift = c_shift(v,256); x=s_space(-3,256*dt,512); vt = cos(2*pi*fc*x).*exp(-x.^2/(4*A^2)); plot(t_shift(t,256),vshift) plot(x,vt) Same 1c) MATLAB CODE
Image of page 2
0 1 2 3 4 5 6 7 8 9 10 -0.4 -0.3 -0.2 -0.1 0 0.1 0.2 0.3 0.4 0.5 “M-file apply FourierT on IFourierT data 1(b)” Vf= FourierT(vshift,dt); plot(f,Vf) It is different because of the shift in the axis and putting the graph together with c_shift and t_shift. It created a negative amplitude. 1d) MATLAB CODE “M-file added padding” vpad = [v,zeros(1,512)]; Vpad = FourierT(vpad,dt); fpad=s_space(0,100,512+512); plot(fpad,Vpad) axis([0 10 0 0.5])
Image of page 3

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
0 1 2 3 4 5 6 7 8 9 10 0 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0.45 0.5 Much smoother
Image of page 4
Image of page 5
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern