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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started