3015_Homework_9_Solutions

# 3015_Homework_9_Solutions - Normalize coefficients Using...

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

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

View Full Document

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

View Full Document

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

View Full Document
Matlab Problem clear all close all load 3015_Discussion_7_Matlab % Fourier tansform f_oboe=fftshift(fft(oboe)); N=length(f_oboe); %Frequency axis (in Hertz) f=-fs/2:fs/(N-1):fs/2; plot(f,abs(f_oboe)); title ('FFT') xlabel('Frequency (Hz)') ylabel('Amplitude') k_min=round(f(1)/440); k_max=round(f(end)/440); %Find peaks for k=k_min:k_max index_f=find(f>=(k*440-220) & f<=(k*440+220)); %Find peak inside a window of 440Hz [value,pos]=max(abs(f_oboe(index_f))); %pos is the position of the peak coeff_oboe(k+k_max+1)=f_oboe(index_f(pos)); end %coeff_oboe=fftshift(coeff_oboe); %Negative frequencies % Find signal power t=0:1/fs:(length(oboe)-1)/fs; index=find(t>0.75 & t<=0.75+1/440); %Signal during sustain time power_oboe=sum(oboe(index).^2)./length(index);

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: % Normalize coefficients % Using Parseval, sum of squares of coefficients equals signal power norm=sum(abs(coeff_oboe).^2); coeff_oboe=coeff_oboe*sqrt(power_oboe/norm); %renormalize coefficients %Plot resulting coefficients figure stem(k_min:k_max,abs(coeff_oboe)); title ('Fourier Series Coefficients'); xlabel('k') ylabel('a_k') % Amplitude of coefficients may not coincide exacly with the one from % Discussion# 7. This is because here we used the whole signal to find the % coefficients, whereas in Discussion #7 only one period was used. -2.5-2-1.5-1-0.5 0.5 1 1.5 2 2.5 x 10 4 1000 2000 3000 4000 5000 6000 7000 8000 FFT Frequency (Hz) Amplitude-50-40-30-20-10 10 20 30 40 50 0.02 0.04 0.06 0.08 0.1 0.12 0.14 Fourier Series Coefficients k a k...
View Full Document

{[ snackBarMessage ]}

### Page1 / 8

3015_Homework_9_Solutions - Normalize coefficients Using...

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

View Full Document
Ask a homework question - tutors are online