Previous              Contents              Next


 

Example 2: IFFT_FloatOut()

 

include c:\dsp_1for2\dsp_1for2.inc      ;prototypes,  datatypes and structures definitions
includelib c:\dsp_1for2\dsp_1for2.lib      ;import library

N     equ     256

.data?


SpectrumIn COMPLEX N/2+1 dup(?);Input spectrum, array of N/2+1 COMPLEX points
SignalOut  FSIGNAL N dup(?);Output signal, array of N FSIGNAL points

DspStruct1 DSPSTRUCT <> ;uninitialized DSPSTRUCT structure
.
.

.code
.
.

;The following is in the window procedure:
;----------------------------------------


.if uMsg==WM_CREATE ;initialization

    invoke NewDSP,N,addr dspstruct1,1 ;allocate 1     computation block
;here: fill the input spectrum (SpectrumIn) with test values
.
.

.elseif uMsg==WM_COMMAND ;menu
   

    mov eax,wParam ;as any other program

    .if ax==IDM_COMPUTE_SIGNAL ;user chooses to compute     signal
   

        invoke IFFT_FloatOut ,addr SpectrumIn,addr         SignalOut,DSPSTRUCTs ptr DspStruct1
     ;Note that we passed the 1st 4 members of the DSPSTRUCT structure by casting it to a DSPSTRUCTs structure using "DSPSTRUCTs ptr"
.

.
    .endif ;menu
.elseif uMsg==WM_DESTROY ;clean up

    invoke DeleteDSP,addr dspstruct1

.
.

.endif ;uMsg
 

.
.

end

 


Previous              Contents              Next