필터 지우기
필터 지우기

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 CenterFile Exchange에서 Discrete 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