EDIT : - ToRealAmplitude is not a good name because of "Real." I thought I might call it ToAmplitudes, note the plural, but is that too close to the existing ToAmplitude method name? I will also add the complementary ToPhases method.
That would waste some time. After you DIM an array .NET fills it with zeros so on a new array it is only necessary to fill in the Real values.- send, in the data() array to the FFT object, only the real values- the imaginary 0 samples are generated inernally in the FFT dll
I've already suggested that in the post above but I need a better name or to rename some existing methods, any suggestions?- get back only the first half of the real and imaginary samples, only the useful ones
I'll leave that to someone who is more confident with the maths than I am.or eventually use a 'FFT algorithm specialized for real and/or symmetric data' with the same inputs and outputs.
I'll wait till you have done thatI will make some improvements.
I've already got ToAmplitude and ToPhase. How about GetAmplitute and GetPhase or shall I do a complete rename of the existing methods? What did you intend ToAmplitudePhase to do?Perhaps:
ToAmplitudePhase
ToAmplitude
ToPhase
[SIZE=2]data[/SIZE][SIZE=2][COLOR=#006400][SIZE=2][COLOR=#006400][[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]j[/SIZE][SIZE=2][COLOR=#006400][SIZE=2][COLOR=#006400]] = [/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]data[/SIZE][SIZE=2][COLOR=#006400][SIZE=2][COLOR=#006400][[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]i[/SIZE][SIZE=2][COLOR=#006400][SIZE=2][COLOR=#006400]] - [/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]wd_real[/SIZE][SIZE=2][COLOR=#006400][SIZE=2][COLOR=#006400];[/COLOR][/SIZE]
[/COLOR][/SIZE][SIZE=2]data[/SIZE][SIZE=2][COLOR=#006400][SIZE=2][COLOR=#006400][[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]j [/SIZE][SIZE=2][COLOR=#006400][SIZE=2][COLOR=#006400]+ [/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#00008b][SIZE=2][COLOR=#00008b]1[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#006400][SIZE=2][COLOR=#006400]] = [/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]data[/SIZE][SIZE=2][COLOR=#006400][SIZE=2][COLOR=#006400][[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]i [/SIZE][SIZE=2][COLOR=#006400][SIZE=2][COLOR=#006400]+ [/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#00008b][SIZE=2][COLOR=#00008b]1[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#006400][SIZE=2][COLOR=#006400]] - [/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]wd_imag[/SIZE][SIZE=2][COLOR=#006400][SIZE=2][COLOR=#006400];[/COLOR][/SIZE]
[/COLOR][/SIZE][SIZE=2]data[/SIZE][SIZE=2][COLOR=#006400][SIZE=2][COLOR=#006400][[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]i[/SIZE][SIZE=2][COLOR=#006400][SIZE=2][COLOR=#006400]] += [/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]wd_real[/SIZE][SIZE=2][COLOR=#006400][SIZE=2][COLOR=#006400];[/COLOR][/SIZE]
[/COLOR][/SIZE][SIZE=2]data[/SIZE][SIZE=2][COLOR=#006400][SIZE=2][COLOR=#006400][[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]i [/SIZE][SIZE=2][COLOR=#006400][SIZE=2][COLOR=#006400]+ [/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#00008b][SIZE=2][COLOR=#00008b]1[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#006400][SIZE=2][COLOR=#006400]] += [/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]wd_imag[/SIZE][SIZE=2][COLOR=#006400][SIZE=2][COLOR=#006400];[/COLOR][/SIZE][/COLOR][/SIZE]
real[SIZE=2]data[/SIZE][SIZE=2][COLOR=#006400][SIZE=2][COLOR=#006400][[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]j[/SIZE][SIZE=2][COLOR=#006400][SIZE=2][COLOR=#006400]] = [/COLOR][COLOR=black]real[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=black]da[/COLOR]ta[/SIZE][SIZE=2][COLOR=#006400][SIZE=2][COLOR=#006400][[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]i[/SIZE][SIZE=2][COLOR=#006400][SIZE=2][COLOR=#006400]] - [/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]wd_real[/SIZE][SIZE=2][COLOR=#006400][SIZE=2][COLOR=#006400];[/COLOR][/SIZE]
[/COLOR][/SIZE][SIZE=2]imagdata[/SIZE][SIZE=2][COLOR=#006400][SIZE=2][COLOR=#006400][[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]j[/SIZE][SIZE=2][COLOR=#006400][SIZE=2][COLOR=#006400]] = [/COLOR][COLOR=black]imag[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=black]d[/COLOR]ata[/SIZE][SIZE=2][COLOR=#006400][SIZE=2][COLOR=#006400][[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]i[/SIZE][SIZE=2][COLOR=#006400][SIZE=2][COLOR=#006400]] - [/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]wd_imag[/SIZE][SIZE=2][COLOR=#006400][SIZE=2][COLOR=#006400];[/COLOR][/SIZE]
[/COLOR][/SIZE][SIZE=2]realdata[/SIZE][SIZE=2][COLOR=#006400][SIZE=2][COLOR=#006400][[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]i[/SIZE][SIZE=2][COLOR=#006400][SIZE=2][COLOR=#006400]] += [/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]wd_real[/SIZE][SIZE=2][COLOR=#006400][SIZE=2][COLOR=#006400];[/COLOR][/SIZE]
[/COLOR][/SIZE][SIZE=2]imagdata[/SIZE][SIZE=2][COLOR=#006400][SIZE=2][COLOR=#006400][[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]i[/SIZE][SIZE=2][COLOR=#006400][SIZE=2][COLOR=#006400]] += [/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]wd_imag[/SIZE][SIZE=2][COLOR=#006400][SIZE=2][COLOR=#006400];[/COLOR][/SIZE][/COLOR][/SIZE]
[SIZE=2]real[/SIZE][SIZE=2][COLOR=#006400][SIZE=2][COLOR=#006400][[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]j[/SIZE][SIZE=2][COLOR=#006400][SIZE=2][COLOR=#006400]] = [/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]real[/SIZE][SIZE=2][COLOR=#006400][SIZE=2][COLOR=#006400][[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]i[/SIZE][SIZE=2][COLOR=#006400][SIZE=2][COLOR=#006400]] - [/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]wd_real[/SIZE][SIZE=2][COLOR=#006400][SIZE=2][COLOR=#006400];[/COLOR][/SIZE]
[/COLOR][/SIZE][SIZE=2]imag[/SIZE][SIZE=2][COLOR=#006400][SIZE=2][COLOR=#006400][[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]j[/SIZE][SIZE=2][COLOR=#006400][SIZE=2][COLOR=#006400]] = [/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]imag[/SIZE][SIZE=2][COLOR=#006400][SIZE=2][COLOR=#006400][[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]i[/SIZE][SIZE=2][COLOR=#006400][SIZE=2][COLOR=#006400]] - [/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]wd_imag[/SIZE][SIZE=2][COLOR=#006400][SIZE=2][COLOR=#006400];[/COLOR][/SIZE]
[/COLOR][/SIZE][SIZE=2]imag[/SIZE][SIZE=2][COLOR=#006400][SIZE=2][COLOR=#006400][[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]i[/SIZE][SIZE=2][COLOR=#006400][SIZE=2][COLOR=#006400]] += [/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]wd_real[/SIZE][SIZE=2][COLOR=#006400][SIZE=2][COLOR=#006400];[/COLOR][/SIZE]
[/COLOR][/SIZE][SIZE=2]imag[/SIZE][SIZE=2][COLOR=#006400][SIZE=2][COLOR=#006400][[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]i[/SIZE][SIZE=2][COLOR=#006400][SIZE=2][COLOR=#006400]] += [/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]wd_imag[/SIZE][SIZE=2][COLOR=#006400][SIZE=2][COLOR=#006400];[/COLOR][/SIZE][/COLOR][/SIZE]
[SIZE=2]real[/SIZE][SIZE=2][COLOR=#006400][SIZE=2][COLOR=#006400][[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]j[/SIZE][SIZE=2][COLOR=#006400][SIZE=2][COLOR=#006400]] = [/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]real[/SIZE][SIZE=2][COLOR=#006400][SIZE=2][COLOR=#006400][[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]i[/SIZE][SIZE=2][COLOR=#006400][SIZE=2][COLOR=#006400]] - [/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]wd_real[/SIZE][SIZE=2][COLOR=#006400][SIZE=2][COLOR=#006400];[/COLOR][/SIZE]
[/COLOR][/SIZE][SIZE=2]imag[/SIZE][SIZE=2][COLOR=#006400][SIZE=2][COLOR=#006400][[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]j[/SIZE][SIZE=2][COLOR=#006400][SIZE=2][COLOR=#006400]] = [/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]imag[/SIZE][SIZE=2][COLOR=#006400][SIZE=2][COLOR=#006400][[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]i[/SIZE][SIZE=2][COLOR=#006400][SIZE=2][COLOR=#006400]] - [/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]wd_imag[/SIZE][SIZE=2][COLOR=#006400][SIZE=2][COLOR=#006400];[/COLOR][/SIZE]
[/COLOR][/SIZE][SIZE=2][COLOR=red]real[/COLOR][/SIZE][SIZE=2][COLOR=#006400][SIZE=2][COLOR=#006400][[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]i[/SIZE][SIZE=2][COLOR=#006400][SIZE=2][COLOR=#006400]] += [/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]wd_real[/SIZE][SIZE=2][COLOR=#006400][SIZE=2][COLOR=#006400];[/COLOR][/SIZE]
[/COLOR][/SIZE][SIZE=2]imag[/SIZE][SIZE=2][COLOR=#006400][SIZE=2][COLOR=#006400][[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]i[/SIZE][SIZE=2][COLOR=#006400][SIZE=2][COLOR=#006400]] += [/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]wd_imag[/SIZE][SIZE=2][COLOR=#006400][SIZE=2][COLOR=#006400];[/COLOR][/SIZE][/COLOR][/SIZE]
V1.1 takes a single data() arrayWhat version is FFTV1.2 ?
On the device go to Start -> Settings -> Input -> Options (Tab NOT button). The voice recording format selected there may alter what the library records.Because of the way the B4PPC recorder dlls are made now, I seem to be stuck to 11025 samples/second only.
EDIR:- Probably not. It looks like the format is burnt into the library code.
I fail to understand your words about taking one sample out of 4,
there might be something I don't get there
In fact, there is about 80 rpm between 2 frequencies
I don't agree with that:
- with a sampling rate of 11025 Hz you get 9.07E-5 s sampling time interval
- with 4096 samples this gives .3715 s time window duration
- this gives 1/.3715 = 2.69 Hz frequency interval which is 161 rpm so +/- 80 rpm
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?