Solving FFT Issues in Real World - Hi, I'm Using YouTube Vid

In summary: I am getting B7 (musical note) b′′′′ Four-lined 3951.066 FrequencyIn summary, the program is outputting a B7 (musical note) b′′′′ Four-lined 3951.066 Frequency when inputting sin waves.
  • #1
btb4198
572
10
Hi
so I have a working FFT. I tested it but inputting sin waves into it.
will not i am inputting sound waves from a Mic and it is not looking to do...
example:
I am using to youtube vid

it outputs B7 (Musical note) b′′′′ Four-lined 3951.066 Frequency
and I run my program this is what I am getting 3951.066

I am getting more action around 41951, 42112, 20062, and 24035

then
3951.066

so is there anything I am add to my FFT that would help ?

oh I am sampling at 44100 Hz
and my N = 88200

I also tried this one
http://www.youtube.com/watch?v=tgMQOAWeVs0&list=PLE558EB4A35F28F6A

and I got a higher magnitude from 424.5 and 435.5
then
from 528
do you think there too much noise coming from the computer speakers ?
 
Last edited by a moderator:
Engineering news on Phys.org
  • #2
As I wrote in your other thread, you most probably made an error in your program.
 
  • #3
If you want meaningful help please consider posting your code.
 
  • #4
public polar1[] FFT(polar1[] x)
{
int N2 = x.Length;
polar1[] X = new polar1[N2];
if (N2 == 1)
{
return x;
}
polar1[] odd = new polar1[N2 / 2];
polar1[] even = new polar1[N2 / 2];
polar1[] Y_Odd = new polar1[N2 / 2];
polar1[] Y_Even = new polar1[N2 / 2]; for (int t = 0; t < N2 / 2; t++)
{
even[t].img = x[t * 2].img;
even[t].real = x[t * 2].real;
odd[t].img = x[(t * 2) + 1].img;
odd[t].real = x[(t * 2) + 1].real;
}
Y_Even = FFT(even);
Y_Odd = FFT(odd);
polar1 temp4;

for (int k = 0; k < (N2 / 2); k++)
{
temp4 = Complex1(k, N2);
X[k].real = Y_Even[k].real + (Y_Odd[k].real * temp4.real);
X[k + (N2 / 2)].real = Y_Even[k].real - (Y_Odd[k].real * temp4.real);
X[k].img = Y_Even[k].img + (Y_Odd[k].real * temp4.img);
X[k + (N2 / 2)].img = Y_Even[k].img - (Y_Odd[k].real * temp4.img);
}

return X;
} public polar1 Complex1(int K, int N3)
{
polar1 temp;
double temp1;
temp1 = (2D * Math.PI *K) / N3;
temp.real = Math.Cos(temp1);
temp.img = Math.Sin(temp1);
return temp;

} public struct polar1
{
public double real;
public double img;

};
 
  • #5
DrClaude

have you had time to look at the code ?
what do you think?
that is the same code i use in my other thread
 
  • #6
I'm sorry, but I don't have the patience to read through an implementation of a FT. If you just need the result, then use one of the many wonderful implementations available (GSL, FFTW, etc.). If you are doing it to learn about numerical methods, then roll up your sleves and debug the code as if there was no tomorrow. You will probably not learn as much if someone else just points out the error.
 
  • #7
that is cool.. but I do think it is working
 

1. What is FFT and why is it important in the real world?

FFT stands for Fast Fourier Transform and it is a mathematical algorithm used to quickly analyze and process signals in the frequency domain. It is important in the real world because it allows for efficient and accurate analysis of large amounts of data, which is crucial in fields such as signal processing, audio and image processing, and data compression.

2. What are some common issues encountered when using FFT in real world applications?

Some common issues with using FFT in real world applications include aliasing, leakage, and spectral leakage. Aliasing occurs when the sampling rate is too low, resulting in incorrect frequency information. Leakage occurs when the signal being analyzed does not have an exact frequency match in the FFT algorithm, leading to inaccurate results. Spectral leakage is a type of leakage that occurs when the signal being analyzed is not periodic, causing energy to leak into neighboring frequency bins.

3. How can I solve aliasing, leakage, and spectral leakage when using FFT?

To solve aliasing, it is important to ensure that the sampling rate is high enough to accurately capture the frequency information of the signal. To address leakage, techniques such as windowing can be used to reduce the impact of signals that do not have an exact frequency match. Spectral leakage can be mitigated by using windowing techniques and applying zero-padding to the signal before performing the FFT.

4. Are there any limitations to using FFT in real world applications?

One limitation of using FFT in real world applications is that it assumes the signal being analyzed is stationary, meaning that its statistical properties do not change over time. This may not always hold true in real world scenarios, leading to inaccurate results. Additionally, FFT is only effective for signals that are linear and time-invariant, which may not always be the case in real world applications.

5. How can I use FFT in conjunction with other techniques to improve its performance?

FFT can be combined with other techniques such as filtering, interpolation, and decimation to improve its performance in real world applications. Filtering can help remove unwanted noise from the signal, while interpolation and decimation can help increase or decrease the sampling rate, respectively, to better match the frequency content of the signal. Additionally, using a combination of different windowing techniques can also help improve the accuracy of FFT results.

Similar threads

  • Electrical Engineering
Replies
9
Views
2K
  • Electrical Engineering
Replies
29
Views
6K
Replies
38
Views
4K
  • Electrical Engineering
Replies
4
Views
2K
  • Electromagnetism
Replies
6
Views
670
  • Electrical Engineering
Replies
6
Views
2K
  • Electrical Engineering
Replies
11
Views
8K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
8
Views
1K
  • Electrical Engineering
Replies
24
Views
4K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
2K
Back
Top