Skip to content

Support randomizing phase as well as magnitude#33

Open
dpw13 wants to merge 3 commits into
pmarks-net:masterfrom
dpw13:dwagner/fft
Open

Support randomizing phase as well as magnitude#33
dpw13 wants to merge 3 commits into
pmarks-net:masterfrom
dpw13:dwagner/fft

Conversation

@dpw13

@dpw13 dpw13 commented Nov 29, 2025

Copy link
Copy Markdown

Adds the option to use an IFFT with randomized phase and magnitude instead of the IDCT with only randomized magnitude. This is important for a number of signal processing reasons, but perceptually this helps reduce the tonal resonance caused by the consistently aligned phase of each component sinusoid generated by the IDCT. From a technical perspective, randomizing the phase of each frequency component between blocks results in more uniform noise in the output.

This change also increases the resolution in the randomized magnitude for the IDCT, using 16 bits of entropy for the magnitude for both the IDCT and IFFT and using 16 bits of entropy for the phase of the IFFT. This more closely matches the dynamic range capacity of the output, ensuring minimal similarity between neighboring blocks which should also reduce the tonal resonance perceptible in the output.

* Properly normalize FFT results using sqrt(1/N) to match IDCT behavior
* Remove multi-threading
* Remove LargeArray functionality
@pmarks-net

Copy link
Copy Markdown
Owner

Do you have evidence that this results in a measurable improvement?

I think IDCT() and IFFT() are equivalently able to produce real-valued noise, so you'll have to convince me why adding complex numbers is better.

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

Successfully merging this pull request may close these issues.

2 participants