0% found this document useful (0 votes)
38 views14 pages

T 0:0.0001:1 F 100 A 10 X A Sin (2 Pi F T) y FFT (X) Yabs Abs (Y) Subplot (2,1,1), Plot (T, X) Subplot (2,1,2), Plot (T, Yabs)

The document contains code that generates sine and sawtooth waveforms with varying frequencies, takes the fast Fourier transform (FFT) of each waveform, and plots the waveform and the absolute value of its FFT. It explores frequencies of 100, 500, 1000, 2000 for different waveform types and time periods to analyze their frequency spectra.

Uploaded by

oscar1022novoa
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
38 views14 pages

T 0:0.0001:1 F 100 A 10 X A Sin (2 Pi F T) y FFT (X) Yabs Abs (Y) Subplot (2,1,1), Plot (T, X) Subplot (2,1,2), Plot (T, Yabs)

The document contains code that generates sine and sawtooth waveforms with varying frequencies, takes the fast Fourier transform (FFT) of each waveform, and plots the waveform and the absolute value of its FFT. It explores frequencies of 100, 500, 1000, 2000 for different waveform types and time periods to analyze their frequency spectra.

Uploaded by

oscar1022novoa
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 14

1. .

t=0:0.0001:1;
F=100;
A=10;
x=A*sin(2*pi*F*t);
y=fft(x);
yabs=abs(y);
subplot(2,1,1), plot(t,x);
subplot(2,1,2), plot(t,yabs);
2.
t=0:0.0001:1;
F=500;
A=10;
x=A*sin(2*pi*F*t);
y=fft(x);
yabs=abs(y);
subplot(2,1,1), plot(t,x);
subplot(2,1,2), plot(t,yabs);

3. .
t=0:0.0001:1;
F=1000;
A=10;
x=A*sin(2*pi*F*t);
y=fft(x);
yabs=abs(y);
subplot(2,1,1), plot(t,x);
subplot(2,1,2), plot(t,yabs);
4.
t=0:0.0001:1;
F=2000;
A=10;
x=A*sin(2*pi*F*t);
y=fft(x);
yabs=abs(y);
subplot(2,1,1), plot(t,x);
subplot(2,1,2), plot(t,yabs);

5. .

5.1
t=0:0.0001:1;
F=100;
A=10;
x=sawtooth(2*pi*F*t,1/2);
y=fft(x);
yabs=abs(y);
subplot(2,1,1), plot(t,x);
subplot(2,1,2), plot(t,yabs);

5.2

t=0:0.0001:1;
F=500;
A=10;
x=sawtooth(2*pi*F*t,1/2);
y=fft(x);
yabs=abs(y);
subplot(2,1,1), plot(t,x);
subplot(2,1,2), plot(t,yabs);
5.3

t=0:0.0001:1;
F=1000;
A=10;
x=sawtooth(2*pi*F*t,1/2);
y=fft(x);
yabs=abs(y);
subplot(2,1,1), plot(t,x);
subplot(2,1,2), plot(t,yabs);

5.4
t=0:0.0001:1;
F=2000;
A=10;
x=sawtooth(2*pi*F*t,1/2);
y=fft(x);
yabs=abs(y);
subplot(2,1,1), plot(t,x);
subplot(2,1,2), plot(t,yabs);

6. .

6.1

t=0:0.0001:1;
F=100;
A=10;
x=sawtooth(2*pi*F*t);
y=fft(x);
yabs=abs(y);
subplot(2,1,1), plot(t,x);
subplot(2,1,2), plot(t,yabs);
6.2

t=0:0.0001:1;
F=500;
A=10;
x=sawtooth(2*pi*F*t);
y=fft(x);
yabs=abs(y);
subplot(2,1,1), plot(t,x);
subplot(2,1,2), plot(t,yabs);

6.3
t=0:0.0001:1;
F=1000;
A=10;
x=sawtooth(2*pi*F*t);
y=fft(x);
yabs=abs(y);
subplot(2,1,1), plot(t,x);
subplot(2,1,2), plot(t,yabs);

6.4

t=0:0.0001:1;
F=2000;
A=10;
x=sawtooth(2*pi*F*t);
y=fft(x);
yabs=abs(y);
subplot(2,1,1), plot(t,x);
subplot(2,1,2), plot(t,yabs);
7. .

7.1

t=0:0.0001:5;
F=100;
A=10;
x=A*sin(2*pi*F*t);
y=fft(x);
yabs=abs(y);
subplot(2,1,1), plot(t,x);
subplot(2,1,2), plot(t,yabs);
7.2

t=0:0.0001:5;
F=500;
A=10;
x=A*sin(2*pi*F*t);
y=fft(x);
yabs=abs(y);
subplot(2,1,1), plot(t,x);
subplot(2,1,2), plot(t,yabs);

7.3

t=0:0.0001:5;
F=1000;
A=10;
x=A*sin(2*pi*F*t);
y=fft(x);
yabs=abs(y);
subplot(2,1,1), plot(t,x);
subplot(2,1,2), plot(t,yabs);
7.4

t=0:0.0001:5;
F=2000;
A=10;
x=A*sin(2*pi*F*t);
y=fft(x);
yabs=abs(y);
subplot(2,1,1), plot(t,x);
subplot(2,1,2), plot(t,yabs);
8. .

8.1

t=0:0.0001:0.5;
F=100;
A=10;
x=A*sin(2*pi*F*t);
y=fft(x);
yabs=abs(y);
subplot(2,1,1), plot(t,x);
subplot(2,1,2), plot(t,yabs);

8.2
t=0:0.0001:0.5;
F=500;
A=10;
x=A*sin(2*pi*F*t);
y=fft(x);
yabs=abs(y);
subplot(2,1,1), plot(t,x);
subplot(2,1,2), plot(t,yabs);
8.3

t=0:0.0001:0.5;
F=1000;
A=10;
x=A*sin(2*pi*F*t);
y=fft(x);
yabs=abs(y);
subplot(2,1,1), plot(t,x);
subplot(2,1,2), plot(t,yabs);

8.4
t=0:0.0001:0.5;
F=2000;
A=10;
x=A*sin(2*pi*F*t);
y=fft(x);
yabs=abs(y);
subplot(2,1,1), plot(t,x);
subplot(2,1,2), plot(t,yabs);

You might also like