How to get equation of a sound

30 ビュー (過去 30 日間)
Luis Zuniga
Luis Zuniga 2020 年 9 月 4 日
回答済み: Madhav Thakker 2020 年 9 月 9 日
I would like to get the equation for the next sound of piano keys (I have attached the zip with the mp3 file):
By equation I mean the formula of the general trend of the sound. To get the graph above I used the following code:
[x, fs] = audioread("IA de Mate\The Lumineers - April (Part 9 Of 10).mp3")
X = x(:,1);
N = length(x);
t = (0:N-1)/fs;
N/fs
%plot time domain signa
plot(t, x)
grid on
xlabel('time(s)')
ylabel('amplitude')
title('Signal in Time Domain')
  5 件のコメント
Tamir Suliman
Tamir Suliman 2020 年 9 月 4 日
to get the equations
KSSV
KSSV 2020 年 9 月 4 日
@Tamir Suliman: the signal is random, you cannot use polyfit for this.

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

回答 (1 件)

Madhav Thakker
Madhav Thakker 2020 年 9 月 9 日
Hi Luis,
I understand that you want to get the equation of the attached mp3 file. The attached signal is very random. However, you can get a non-intuitive complex equation by using fft in MATLAB.
I am attaching a snippet that might help you –
[x, fs] = audioread("The Lumineers - April (Part 9 Of 10).mp3");
L = numel(x(:,1));
Fn = fs/2; % Nyquist Frequency
xm = x-mean(x); % Subtract Mean To Make Amplitudes At Frequencies>0 More Prominent
FTs = fft(xm)/L; % Fourier Transform
Fv = linspace(0, 1, fix(L/2)+1)*Fn; % Frequency Vector
Iv = 1:length(Fv); % Index Vector
Phs = angle(FTs);
For more details, you can refer to a similar discussion here - https://www.mathworks.com/matlabcentral/answers/348847-how-to-get-equation-of-signal-in-matlab
Hope this helps.

カテゴリ

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

製品


リリース

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by