as a software engineer I encountered some difficulties when working on the problem of signal processing. I do not have much experience in this area.
What I'm trying to do is sample environmental sound with a sampling frequency of 44100 and for windows with a fixed size, to check if a particular frequency (20 kHz) exists and exceeds a threshold value.
Here's what I do according to the perfect answer in How to extract frequency information from samples from PortAudio using FFTW in C
102400 samples (2320 ms) are collected from an audio port with a sampling frequency of 44100. Approximate values ββare between 0.0 and 1.0
int samplingRate = 44100; int numberOfSamples = 102400; float samples[numberOfSamples] = ListenMic_Function(numberOfSamples,samplingRate);
Window size or FFT size - 1024 samples (23.2 ms)
int N = 1024;
Number of windows: 100
int noOfWindows = numberOfSamples / N;
Splitting samples into noOfWindows (100) windows, each of which has a size N (1024) of samples
float windowSamplesIn[noOfWindows][N]; for i:= 0 to noOfWindows -1 windowSamplesIn[i] = subarray(samples,i*N,(i+1)*N); endfor
Applying Hanning window function in each window
float windowSamplesOut[noOfWindows][N]; for i:= 0 to noOfWindows -1 windowSamplesOut[i] = HanningWindow_Function(windowSamplesIn[i]); endfor
Applying FFT for each window (from real to complex conversion performed inside the FFT function)
float frequencyData[noOfWindows][samplingRate/2]; for i:= 0 to noOfWindows -1 frequencyData[i] = RealToComplex_FFT_Function(windowSamplesOut[i], samplingRate); endfor
At the last stage, I use the FFT function implemented in this link: http://www.codeproject.com/Articles/9388/How-to-implement-the-FFT-algorithm ; because I cannot implement the FFT function from scratch.
What I canβt be sure of is to give N (1024) samples of the FFT function as input, the samplingRate / 2 (22050) decibels are returned as output. Is that what the FFT function does?
I understand that because of the Nyquist frequency, I can detect half the frequency of the sampling frequency at best. But is it possible to get decibel values ββfor each frequency before sampling Rate / 2 (22050) Hz?
Thanks, Vahit