- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have a input matrix whose size is (lg_child, lt_parent)and it is defined as
filterd_fourier_coefficients(lg_child, lt_parent)
For each lg_child I take samples of length lt_parent and perform inverse Fourier transformation.
The setup is,
DFTI_DESCRIPTOR_HANDLE ifft = NULL;
status = DftiCreateDescriptor(&ifft, DFTI_DOUBLE, DFTI_COMPLEX, 1, lt_parent);
status = DftiSetValue ( ifft, DFTI_PLACEMENT, DFTI_NOT_INPLACE);
status = DftiCommitDescriptor( ifft);
The input and output is defined as
std::complex<double> samples_in[lt_parent];
std::complex<double> samples_out[lt_parent];
for (int l=0; l<lt_parent; l++)
{
samples_in[l] = filterd_fourier_coefficients(j, l);
}
status = DftiComputeBackward(ifft, samples_in, samples_out);
The output matrix is filtered_grid(lt_child, lg_child) and (lt_child < lt_parent)
for (int i=0; i<lt_child; i++)
{
double phi = trapezoidal_child.get_nodes(i);
filtered_grid(i, j) = sqrt(2.0 * pi) *
Internal::expi(-K * phi) *
samples_out[i];
}
results in bad filtering.
Info: The input matrix is normalized with (1/lt_parent)
What do I have to do when truncating the samples_out and what exactly is missing?
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Fixed: Rather a trivial one but there is one more problem.
Its the part of the implementation of Fast Spherical Filter to interpolate or filter the samples on the sphere.
The steps involve
- Compute the Fourier co-efficients of samples the latitude
- Compute the spherical co-efficients from 1.
- Compute the filtered Fourier co-efficients from 2.
- Finally the filtered grid where the inverse Fourier transformation is performed on filtered Fourier co-efficients
Before attempt to use APIs from Intel, I manually computed the DFT and IDFT in step 1 and 4. Nevertheless the bug is rather trivial and nothing to do with Intel APIs at all.
This is the bug where I miss-allocated the longitude and latitude samples of the sphere.
filtered_grid(lg_child, lt_child)
it should be
filtered_grid(lt_child, lg_child)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm just interested, what fix did you apply?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Though it works with manual computation of Inverse Fourier Transform, I still have a difficulty in using the API to get the correct truncated values.
DFTI_DESCRIPTOR_HANDLE ifft_handle = NULL;
status = DftiCreateDescriptor(&ifft_handle, DFTI_DOUBLE, DFTI_COMPLEX, 1, lt_parent);
status = DftiSetValue ( ifft_handle, DFTI_PLACEMENT, DFTI_NOT_INPLACE);
status = DftiCommitDescriptor( ifft_handle);
for (int j=0; j<lg_child; j++)
{
std::complex<double> x_coefficients_in[lt_parent];
std::complex<double> x_coefficients_out[lt_parent];
for (int l=0; l<lt_parent; l++)
{
x_coefficients_in[l] = filterd_fourier_coefficients(j, l);
}
status = DftiComputeBackward(ifft_handle, x_coefficients_in, x_coefficients_out);
for (int i=0; i<lt_child; i++)
{
double phi = trapezoidal_child.get_nodes(i);
filtered_grid(i, j) = sqrt(2.0 * pi) * Internal::expi(-K * phi) * x_coefficients_out[i];
}
}
status = DftiFreeDescriptor(&ifft_handle);
I have an input x_coefficients_in whose length is lt_parent and after transformation how do I truncate to length lt_child?
Info: lt_parent > lt_child
The code which I have posted does not give the correct results.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Any help in computing the truncation will be much appreciated.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page