Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DCT Normalization - possible bug #182

Open
ACDC77 opened this issue Sep 3, 2024 · 2 comments
Open

DCT Normalization - possible bug #182

ACDC77 opened this issue Sep 3, 2024 · 2 comments

Comments

@ACDC77
Copy link

ACDC77 commented Sep 3, 2024

Hi Dmitrii,

When computing DCT type III (inverse of DCT type II), for 2D formatted data, the configuration.normalize setting seems to have no effect on the output. The output I see is always unnormalized regardless of whether this field is 0 (default) or 1. Could you please try to replicate at your end?

Here are my configuration settings:

config_idct.FFTdim = 2;
config_idct.size[0] = N;
config_idct.size[1] = M;
config_idct.performR2C = false;
config_idct.isInputFormatted = true;
config_idct.isOutputFormatted = true;
config_idct.kernelConvolution = 0;
config_idct.doublePrecision = 0;
config_idct.numberBatches = 1;
config_idct.performDCT = 3;
config_idct.normalize = 1;

Regards,
Atul

@DTolm
Copy link
Owner

DTolm commented Sep 4, 2024

Hello,

the normalize parameter only affects the IFFT - meaning the plan has to be launched with 1 passed as the inverse parameter in VkFFTAppend. All forward transforms are currently unnormalized. So to get normalized DCT-III, you need to launch IDCT-II plan created with normalize flag.

Best regards,
Dmitrii

@ACDC77
Copy link
Author

ACDC77 commented Sep 4, 2024

Thanks @DTolm. I changed the config_idct to the one shown below with DCT type as 2 and normalize = 1, and called VkFFTAppend with 1 (for inverse FFT). Now the results of the inverse DCT are normalized.

config_idct.FFTdim = 2;
config_idct.size[0] = N;
config_idct.size[1] = M;
config_idct.performR2C = false;
config_idct.isInputFormatted = true;
config_idct.isOutputFormatted = true;
config_idct.kernelConvolution = 0;
config_idct.doublePrecision = 0;
config_idct.numberBatches = 1;
config_idct.performDCT = 2;
config_idct.normalize = 1;

initializeVkFFT(&app_idct, config_idct);
VkFFTAppend(&app_idct, 1, &params);

Appreciate the help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants