Question: Hi everyone Could you help to fix this error from this script : Script [x,Fs] = audioread('Falih.wav'); x=x(1000:5000); t = 0:1:length(x)-1; %fourier transform k=0; for

Hi everyone Could you help to fix this error from this script :

Script

[x,Fs] = audioread('Falih.wav'); x=x(1000:5000); t = 0:1:length(x)-1;

%fourier transform k=0; for f=linspace(0,Fs/2,1000) k=k+1; X(k)=trapz(t,x'.*exp(-1j*2*pi*f*t)); end f = linspace(0,Fs/2,1000); figure; subplot(2,1,1); plot(f,abs(x)); grid; xlabel('f in Hz'); ylabel('|X(f)|'); title('magnitude response'); subplot(2,1,2); plot(f,angle(x));grid; xlabel('f in HZ'); title('Phase Response') ylabel('');

and this is the Error :

In an assignment A(:) = B, the number of elements in A and B must be the same.

Error in Bonus1 (line 9) X(k)=trapz(t,x'.*exp(-1j*2*pi*f*t));

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!