フィルターのクリア

Integral Of Audio Signal

11 ビュー (過去 30 日間)
enrique128
enrique128 2020 年 11 月 7 日
コメント済み: enrique128 2020 年 11 月 8 日
Hello everyone, I take my sound from microphone and my main purpose is calculating the Fourier Coefficients of it and coverge it.
But I need to calculate the integral of my audio signal because I need to calculate the coefficients. I tried xtrapz(x,y) and int functions but they don't meet my requirements. How can I calculate the integral of my sound? Thanks.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Error using trapz (line 15)
LENGTH(X) must equal the length of Y in dim 1.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Undefined function 'int' for input arguments of type 'double'.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Also I need some suggestions about the calculating coefficients, thanks.
My code:
recorder= audiorecorder(16000,8,2);
disp('please record your voice');
drawnow();
pause(1);
recordblocking(recorder, 5);
play(recorder);
data=getaudiodata(recorder);
x=0.2:pi/1000:2.2;
trapz(x,data)

回答 (1 件)

Walter Roberson
Walter Roberson 2020 年 11 月 7 日
編集済み: Walter Roberson 2020 年 11 月 7 日
Fs = 16000;
trapz(data)/Fs
But if you need the fourier coefficients then just fft(data)
  4 件のコメント
Walter Roberson
Walter Roberson 2020 年 11 月 7 日
audiorecoder(16000,8,2) means to record with a sampling frequency of 16000 Hz, 8 bits per channel, 2 channels. You are getting two results because you are getting a result for each channel.
If you are calculating the coefficients for discrete fourier transform (fft) then you should not be integrating the signal, and you should be summing the signal instead, sum(data)
enrique128
enrique128 2020 年 11 月 8 日
sir im not calculating dft i will converge it with fourier series so i will not use fft. Is it possible?

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeMeasurements and Spatial Audio についてさらに検索

製品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by