Click here to Skip to main content
15,905,566 members
Home / Discussions / C#
   

C#

 
QuestionProjects/Libraries On Tuning? Pin
Brandon X.27-Dec-08 14:44
Brandon X.27-Dec-08 14:44 
AnswerRe: Projects/Libraries On Tuning? [modified] Pin
Ravadre28-Dec-08 17:32
Ravadre28-Dec-08 17:32 
QuestionRe: Projects/Libraries On Tuning? Pin
Brandon X.29-Dec-08 6:47
Brandon X.29-Dec-08 6:47 
AnswerRe: Projects/Libraries On Tuning? Pin
Ravadre29-Dec-08 7:33
Ravadre29-Dec-08 7:33 
GeneralRe: Projects/Libraries On Tuning? Pin
Brandon X.29-Dec-08 8:10
Brandon X.29-Dec-08 8:10 
GeneralRe: Projects/Libraries On Tuning? Pin
Ravadre29-Dec-08 8:16
Ravadre29-Dec-08 8:16 
QuestionRe: Projects/Libraries On Tuning? [modified] Pin
Brandon X.29-Dec-08 19:29
Brandon X.29-Dec-08 19:29 
AnswerRe: Projects/Libraries On Tuning? Pin
Ravadre30-Dec-08 4:42
Ravadre30-Dec-08 4:42 
Hello,

Few things I can see here is:
If you record wav file, you must be sure what format it is, fe. it can be recored as stereo 16-bit, so then byte align would be:
LL RR LL RR LL RR, where L/R - left/right side byte.
Second - your FFT function does some "magic" work for you (which is not a part of FFT, it's just stuff that author of this code places there so function will return ready to use data, which are:
for (int i = 0; i < n / 2; i++)
      magnitude[i] = (float)(Math.Sqrt((xre[i] * xre[i]) + (xim[i] * xim[i])));
return magnitude;

First of all: return array has length equal to 1/2 of input array, 2nd of all, magnitudes are counted (that's good anyway). The reason why only 1st half of array is returned is that when you do FFT on 1D data, you will always have result data mirrored, always. So if 1st half of output array is:
1 2 4 7 5, the 2nd half would be: 5 7 4 2 1. So it's ok, but you have to remember, to the FreqStep from (44100.0 / length(F)) to (44100.0 / (length(F) * 2))

Ok, and now, for what I think is your error:
I collect all the returned double[] from public static double[] Process(ref byte[] wave) into a List<double[]> lstFFTData, which I then splice back together into one huge array of double[] named arrFinalData.

You don't do that! Smile | :) . Each of those data is an array of some length that contains data about frequency, from circa 0.0Hz up to some value (about half of sampling rate, based on Nyquist law). Each of this array, back from FFT should be counted as a whole. So:
1. Get FFT from short sample (16kBytes in your example)
2. Get highest frequecy from that short array - it's your result
3. Now you can back to step 1., iterate few times and check frequency, it should be very similiar, but you can for example count airthmetic mean.
If you want to get more accurate sample, you can't connect few results from FFT, you have to supply bigger array of data to FFT, so fe. you can use 32KBytes array, which will give you 16k shorts, which will give you 8k doubles after your FFT method, instead of 4k you have now.
QuestionRe: Projects/Libraries On Tuning? [modified] Pin
Brandon X.31-Dec-08 10:24
Brandon X.31-Dec-08 10:24 
AnswerRe: Projects/Libraries On Tuning? Pin
Ravadre31-Dec-08 12:35
Ravadre31-Dec-08 12:35 
QuestionC# .NET Windows Media Player WM_COPYDATA *whimper* Pin
spamoom27-Dec-08 13:44
spamoom27-Dec-08 13:44 
AnswerRe: C# .NET Windows Media Player WM_COPYDATA *whimper* Pin
Richard Andrew x6427-Dec-08 14:45
professionalRichard Andrew x6427-Dec-08 14:45 
QuestionRe: C# .NET Windows Media Player WM_COPYDATA *whimper* Pin
spamoom28-Dec-08 0:13
spamoom28-Dec-08 0:13 
AnswerRe: C# .NET Windows Media Player WM_COPYDATA *whimper* Pin
Richard Andrew x6428-Dec-08 1:36
professionalRichard Andrew x6428-Dec-08 1:36 
GeneralRe: C# .NET Windows Media Player WM_COPYDATA *whimper* Pin
spamoom28-Dec-08 2:04
spamoom28-Dec-08 2:04 
Question[Message Deleted] Pin
TwoSocks27-Dec-08 13:40
TwoSocks27-Dec-08 13:40 
Questionlock the windows xp Pin
abu rakan27-Dec-08 12:06
abu rakan27-Dec-08 12:06 
AnswerRe: lock the windows xp Pin
User 665827-Dec-08 13:00
User 665827-Dec-08 13:00 
Questionavi file Pin
manishkumarcse27-Dec-08 11:57
manishkumarcse27-Dec-08 11:57 
GeneralRe: avi file Pin
Luc Pattyn27-Dec-08 12:38
sitebuilderLuc Pattyn27-Dec-08 12:38 
AnswerRe: avi file Pin
Code Soldier28-Dec-08 5:25
Code Soldier28-Dec-08 5:25 
QuestionDatabase update error help Pin
hatan8627-Dec-08 9:39
hatan8627-Dec-08 9:39 
AnswerRe: Database update error help Pin
Colin Angus Mackay27-Dec-08 9:57
Colin Angus Mackay27-Dec-08 9:57 
GeneralRe: Database update error help Pin
hatan8627-Dec-08 10:18
hatan8627-Dec-08 10:18 
GeneralRe: Database update error help Pin
Colin Angus Mackay27-Dec-08 10:38
Colin Angus Mackay27-Dec-08 10:38 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.