﻿ SCIENTIFIC COMPUTING 澳洲代写_布里斯班论文代写_澳洲代写论文

#### 在線客服  Essay_Cheery   Order Now

# SCIENTIFIC COMPUTING 澳洲代寫

Exercise #3 Part – II due 22:00pm Friday 3 May
(worth 15 % for M3SC and 40% for M 4/5 SC)
Background and discussion
The discrete Real Fourier series represents the periodic real data xj at N discrete points as the sum
of N cosine and sine functions in the form :

This would be a N/2-size discrete Complex Fourier Series if yk = ak + I bk . 0 < k < N/2
Although there are purely real algorithms to calculate xj given ak and bk and vice versa, most
commonly these problems are mapped into a procedure utilizing the Discrete Complex Fourier
Series and Transform.
One of these mappings take two real periodic data sets x1j and x2j 0 < j < N and packs them
into a periodic complex data set zj = x1j + x2j · I of size N and performs the size N Discrete
Complex Fourier Series on this data set: t = CN z . The resultant complex t vector can be
unpacked into the two real size N/2 Fourier Series coefficients by exploiting the fact that for a real
data series xj , the resultant complex yk have the property: yk = y*N-k . [II-2]
For a purely imaginary set of data, the resultant complex yk have the property: yk = - y*N-k .
Thus the yk for each real data set can be recovered for 0 < k < N/2 . In detail:
y 1k = ( tk + t*N-k )/N and y 2k = -I · ( tk - t*N-k )/N 0 < k < N/2.
To recover x1j and x2j 0 < j < N , given y1k and y2k 0 < k < N/2, extend y1k and y2k from
0 < k < N/2 to 0 < k < N using relation [II-2] and then create the complex vector
wk = y1k + y2k · I for 0 < k < N and perform the Discrete Fourier Transform CN-1 w .
The real and imaginary parts of the resultant complex array are the two desired real periodic data.
8. Write the C function to calculate the Discrete Fourier Series of two real data sets, each of
size N and find the two complex vectors z1 and z2 of size N/2 of their Fourier coefficients.
This function should have the prototype:
int TwoReal2Complex(double *R1, double *R2,
complex double *Z1,complex double *Z2,
complex double *w, complex double *Wp, int N)
where: *R1 is a pointer to the type double array to hold R1 from R1 to R1[N-1];
*R2 is a pointer to the type double array holding R2 from R2 to R2[N-1];
*Z1 is a pointer to the type complex double array holding Z1 from Z1 to Z1[N/2];
*Z2 is a pointer to the type complex double array holding Z2 from Z2 to Z2[N/2];
*w is a pointer to the type double array w to w[your choice!] that can be used as
vector temporary storage for intermediate complex works required by your
FastCS(… function.
*Wp is a pointer to the vector or powers of WN created in the section 1 function above
N is the size of the desired transform.)
The function should return 0 if it ‘works’ and something informative if it doesn’t work for

#### 在线客服    