Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advanced MySQL 8 Discover The Full Potential Of MySQL And Ensure High Performance Of Your Database

Authors: Eric Vanier ,Birju Shah ,Tejaswi Malepati

1st Edition

1788834445, 978-1788834445

More Books

Students also viewed these Databases questions