lab report2 - 1.1 n=[0:31 y=sin(2*pi*128*n/2048 stem(n,y...

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

View Full Document Right Arrow Icon
1.1 n=[0:31]; y=sin(2*pi*128*n/2048) stem(n,y); 1.2 function [X,freq]=positiveFFT(x,Fs) N=length(x); k=0:N-1; T=N/Fs; freq=k/T; X=fft(x); cutOff = ceil(N/2); X = X(1:cutOff); freq = freq(1:cutOff); end Fs=2048; n=[0:31]; y=sin(2*pi*128*n/Fs); [YfreqDomain,frequencyRange] = positiveFFT(y,Fs); stem(abs(frequencyRange),abs(YfreqD omain)); xlabel( 'Freq (Hz)' ) ylabel( 'Amplitude' ) title( 'Part 1.2' ) 1.4
Background image of page 1

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

View Full Document Right Arrow Icon
1.6 function [X,freq]=positiveFFT(x,Fs) N=length(x); k=0:N-1; T=N/Fs; freq=k/T; X=fft(x); cutOff = ceil(N/2); X = X(1:cutOff); freq = freq(1:cutOff); end Fs=2048; n=[0:31]; y=sin(2*pi*220*n/Fs); [YfreqDomain,frequencyRange] = positiveFFT(y,Fs); stem(abs(frequencyRange),abs(YfreqD omain)); xlabel( 'Freq (Hz)' ) ylabel( 'Amplitude' ) title( 'Part 1.6' )
Background image of page 2
1.8 Fs=2048; n=[0:511]; y=sin(2*pi*220*n/Fs); [YfreqDomain,frequencyRange] = positiveFFT(y,Fs); stem(abs(frequencyRange),abs(YfreqDomain)) xlabel('Freq (Hz)') ylabel('Amplitude') title('Part 1.8')
Background image of page 3

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

View Full Document Right Arrow Icon
2.2 fo = 100; %frequency of the sine wave
Background 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 ]}

Page1 / 8

lab report2 - 1.1 n=[0:31 y=sin(2*pi*128*n/2048 stem(n,y...

This preview shows document pages 1 - 5. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online