The Fourier transform of Alaska

This forum is for eXpress++ general support.
Post Reply
Message
Author
User avatar
Eugene Lutsenko
Posts: 1649
Joined: Sat Feb 04, 2012 2:23 am
Location: Russia, Southern federal district, city of Krasnodar
Contact:

The Fourier transform of Alaska

#1 Post by Eugene Lutsenko »

Somebody realized the discrete Fourier transform in Alaska?

https://en.wikipedia.org/wiki/Discrete_ ... _transform

Here is a BASIC:

http://www.analog.com/media/en/technica ... ok_Ch8.pdf

http://rsdn.ru/forum/mfc/452905.1

Code: Select all

Это тип данных, в котором хранятся отсчеты кривой:
 
Type complex
    Re As Double
    Im As Double
End Type

Перед вызовом функции нужно заполнить массив А() числами. Причем A.Re()=величина сигнала, а A.Im=0
Потом вызываем FFT(). Она возвращает результат в том же массиве A()
 
 
Пользоваться так:
int A(255),i;
A(i).Re=sin(2*PI*i/255); // какая-то кривая
A(i).Im=0;    // все это для всех 256 точек
FFT(256,&A); /* именно 256, а не 255 */
 
Ниже идет текст подпрограммы быстрого преобр. Фурье на бейсике.
 
 
Sub FFT(n As Integer, A() As complex) 'кол-во точек, действит., мнимые
Dim j, i, N2, N1, D1, D2, K, M, l, l1, l2, U1, U2, W1, W2, I1, t1, t2, U3
N2 = n / 2: N1 = n - 1: j = 1
M = Fix(Log(n) / Log(2) + 0.1)
For i = 1 To N1  'перестановка
    If i < j Then
        D1 = A(j).Re: A(j).Re = A(i).Re: A(i).Re = D1
        D2 = A(j).Im: A(j).Im = A(i).Im: A(i).Im = D2
    End If
    K = N2
    While (K < j)
        j = j - K: K = K / 2
    Wend
    j = j + K
Next i
 
'FFT
For l = 1 To M
l1 = 2 ^ l
l2 = l1 / 2
U1 = 1: U2 = 0
W1 = Cos(PI / l2): W2 = -Sin(PI / l2)
For j = 1 To l2
For i = j To n Step l1
    I1 = i + l2
    t1 = A(I1).Re * U1 - A(I1).Im * U2: t2 = A(I1).Im * U1 + A(I1).Re * U2
    A(I1).Re = A(i).Re - t1: A(I1).Im = A(i).Im - t2
    A(i).Re = A(i).Re + t1: A(i).Im = A(i).Im + t2
Next i
U3 = U1: U1 = U1 * W1 - U2 * W2: U2 = U2 * W1 + U3 * W2
Next j
Next l
 
End Sub

User avatar
rdonnay
Site Admin
Posts: 4813
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: The Fourier transform of Alaska

#2 Post by rdonnay »

You may want to use the free FFTDLL.DLL.

http://heliso.tripod.com/programm/fft/fftdll.htm
The eXpress train is coming - and it has more cars.

User avatar
Eugene Lutsenko
Posts: 1649
Joined: Sat Feb 04, 2012 2:23 am
Location: Russia, Southern federal district, city of Krasnodar
Contact:

Re: The Fourier transform of Alaska

#3 Post by Eugene Lutsenko »

Thank you very much, Roger!

I did not even expect it to have. But I looked up, there is an example on VC. But how to do in Alaska? Is it possible to use the in Alaska this DLL and LIB? Library functions such as described by you indicated address.

User avatar
rdonnay
Site Admin
Posts: 4813
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: The Fourier transform of Alaska

#4 Post by rdonnay »

Did you download the DLL?

My ESET security blocked me from do the download and said it's a security risk.
I guess I should have tried that first before recommending it.
The eXpress train is coming - and it has more cars.

User avatar
Eugene Lutsenko
Posts: 1649
Joined: Sat Feb 04, 2012 2:23 am
Location: Russia, Southern federal district, city of Krasnodar
Contact:

Re: The Fourier transform of Alaska

#5 Post by Eugene Lutsenko »

I have Avast missed everything. It's okay to download.

Now Eidos system which I develop, I can load external data table, text and graphic appearance. And poom based on these data can build intelligent models and solve a number of problems. And I want more opportunity to make audio data download and their generalizations, identification, etc ..

User avatar
rdonnay
Site Admin
Posts: 4813
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: The Fourier transform of Alaska

#6 Post by rdonnay »

After looking again at the documentation, I see that this will require binary arrays to pass as parameters.

This isn't going to be easy.

It may be easier to just convert PHP code.
I saw several sites that has the FFT algorithm written in PHP.

Unfortunately, I don't have the time to do this for you. It will take several hours and then I'm not sure how to test it.
The eXpress train is coming - and it has more cars.

User avatar
Eugene Lutsenko
Posts: 1649
Joined: Sat Feb 04, 2012 2:23 am
Location: Russia, Southern federal district, city of Krasnodar
Contact:

Re: The Fourier transform of Alaska

#7 Post by Eugene Lutsenko »

Thank you, Roger!
Of course you do not need to spend time on it. Try it yourself to find out. If possible, the result is laid out on the forum.
PS
I also saw such sites.

Post Reply