how implement FFT to ringtone/music

1 回表示 (過去 30 日間)
Tham  Wei Jian
Tham Wei Jian 2019 年 11 月 23 日
回答済み: Kaashyap Pappu 2019 年 11 月 26 日
I have generated a ringtone is "twinkle twinkle little start", but I need to determine its frequency doamin. Can someone help me how to generate a FFT from these tone.
clear; clc;
Fs=1800;
Ts=1/Fs;
Ns=Fs;
t=[0:Ts:0.5];
k=2;
C4 = sin(2*pi*261.6*t);
D4 = sin(2*pi*293.7*t);
E4 = sin(2*pi*329.2*t);
F4 = sin(2*pi*349.2*t);
G4 = sin(2*pi*392.0*t);
A4 = sin(2*pi*440.0*t);
C4_H = sin(2*pi*k*261.6*t);
D4_H = sin(2*pi*k*293.7*t);
E4_H= sin(2*pi*k*329.2*t);
F4_H= sin(2*pi*k*349.2*t);
G4_H= sin(2*pi*k*392.0*t);
A4_H= sin(2*pi*k*440.0*t);
Line1 = [C4 C4 G4 G4 A4 A4 G4];
Line2 = [F4 F4 E4 E4 D4 D4 C4];
Line1_H = [C4_H C4_H G4_H G4_H A4_H A4_H G4_H];
Line2_H = [F4_H F4_H E4_H E4_H D4_H D4_H C4_H];
x1=[Line1 Line2];
x2=[Line1_H Line2_H];
  1 件のコメント
Walter Roberson
Walter Roberson 2019 年 11 月 23 日
See the first example in the fft() documentation.

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

回答 (1 件)

Kaashyap Pappu
Kaashyap Pappu 2019 年 11 月 26 日
As Walter mentioned, you can use the fft function to carry out the Fast Fourier Transform operation using one the of the examples provided within the documentation. If you are interested in a 2-sided spectrum, you can use fftshift function to make the zero frequency point to be the center value of the array.
Hope this helps!

カテゴリ

Help Center および File ExchangeDiscrete Fourier and Cosine Transforms についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by