Question: % FAST FOURIER TRANSFORM ALGORITHM 8 . 3 % % To compute the coefficients in the discrete approximation % for the data ( x (
FAST FOURIER TRANSFORM ALGORITHM To compute the coefficients in the discrete approximation for the data xJyJJm where mp and xJpiJpim for Jm INPUT: m; yyym OUTPUT: complex numbers ccm; real numbers aam; bbm symsOK 'FLAG', MNJJJYA; symsNAME 'INP', FZ 'OUP', TWNC; symsNGNUYYWWXWKLM; symsNPTTxs; TRUE ; FALSE ; fprintf'This is the Fast Fourier Transform.
; fprintf'The file IBR.m is used by this program.
; fprintf'The user must make provisions if the
; fprintf'interval is not pipi
; OK FALSE; while OK FALSE fprintf'Choice of input method:
; fprintf Input entry by entry from keyboard
; fprintf Input data from a text file
; fprintf Generate data using a function F
; fprintf'Choose or please
; FLAG input; if FLAG FLAG FLAG OK TRUE; end; end; if FLAG OK FALSE; while OK FALSE fprintf'Input m
; M input; if M OK TRUE; N M; Y zerosN; for JJ : N J JJ; fprintf'Input yd
J; YJJ input; end; else fprintf'Number must be a positive integer.
; end; end; end; if FLAG fprintf'Has a text file been created with the ; fprintf'entries yym
; fprintf'separated by a blank?
; fprintf'Enter Y or N
; A inputs; if A Y A y fprintf'Input the file name in the form ; fprintf'drive:
ame.ext
; fprintf'for example: A:DATADTA
; NAME inputs; INP fopenNAMErt; OK FALSE; while OK FALSE fprintf'Input number m
; M input; N M; Y zerosN; if N for JJ : N YJJ fscanfINPf; end; fcloseINP; OK TRUE; else fprintf'Number must be a positive integer.
; end; end; else fprintf'The program will end so the input file can ; fprintfbe created.
; OK FALSE; end; end; if FLAG fprintf'Input the function Fx in terms of x
; fprintf'for example: cosx
; s input; F inlinesx; OK FALSE; while OK FALSE fprintf'Input the number m
; M input; N M; Y zerosN; if N for JJ : N Z piJJpiM; YJJ FZ; end; OK TRUE; else fprintf'Number must be a postive integer.
; end; end; end; if OK TRUE fprintf'Choice of output method:
; fprintf Output to screen
; fprintf Output to text file
; fprintf'Please enter or
; FLAG input; if FLAG fprintf'Input the file name in the form drive:
ame.ext
; fprintf'for example: A:OUTPUTDTA
; NAME inputs; OUP fopenNAMEwt; else OUP ; end; fprintfOUP 'FAST FOURIER TRANSFORM
; TW log; STEP use N for m NG for p NU for q WW for zeta N floorN; STEP C zerosN; for JJ : N CJJ YJJ; end; Z N; NG roundlogZTW; NU NG; YY pisqrtN; WW expYY; STEP W zerosN; for JJ : N X ; YY ; for J : JJ YY XWW; X YY; end; WJJ X; WNJJX; end; STEP K ; STEP for L : NG STEP while K N STEP for JJ : N STEP Z expNUTW; M roundZ; M floorKM; IBR does the bit reversal NP IBRMNG; T is eta T CKN; STEP if NP ~ X T; T XWNP; end; CKN CKT; CK CKT; STEP K K; end; STEP K KN; end; STEP K ; N floorN; NU NU; end; STEP while K N STEP JJ IBRKNG; STEP if JJ K T CK; CK CJJ; CJJ T; end; STEP K K; end; STEPS and fprintfOUP 'Coefficients c cm
; for JJ : N YY JJpisqrt; X expYY; YY XCJJ; CJJ YYN; K JJ; fprintfOUPd f f
K realCJJimagCJJ; end; fprintfOUP
Coefficients a am
; for JJ : M fprintfOUPf
realCJJ; end; fprintfOUP
Coefficients b bm <
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
