lab report2

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

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

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

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

View Full Document
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' )
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')

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

View Full Document
2.2 fo = 100; %frequency of the sine wave
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
Ask a homework question - tutors are online