FORUM

FORUM



SearchSearch   Users   Registration   Entrance
Today: 04.04.2026 - 15:01:19
Pages:  1  2  

JSFX real FFT (v5.25+)

AuthorMessage

Ralliart

usr


Statistics:
Messages: 26
Registration: 09.27.2001

I used a rectangular window. This works fine for my needs. You can check it. I made a large window size and use the middle part Let me explain why I did - it works much faster without much loss ============ Of course, we get some artifacts, but with a large window size are not significant. I wrote about it in the comments



Message # 11 14.10.22 - 21:14:55
RE: JSFX real FFT (v5.25+)

Aren G

usr


Statistics:
Messages: 2,533
Registration: 07.04.2002

You seem to use "block_size = 1024*16". So FFT-Windowsize = 16384. -Michael



Message # 12 14.10.22 - 21:24:50
RE: JSFX real FFT (v5.25+)

///MPowered

usr


Statistics:
Messages: 2
Registration: 07.31.2002

Oh sure. I just did not use window function. Rectangular suits me here. I did a lot of tests, and this works well at large window sizes. I select middle part of the window to avoid the large artifacts. Then I connect these areas. I can show you how it sounds === This function creates a file from an array of numbers You can use it to test filter. Also, there is eel version


---------------------
Let me show you the difference between a fast car, and a M car.
Message # 13 14.10.22 - 21:31:53
RE: JSFX real FFT (v5.25+)

samiam3356

usr


Statistics:
Messages: 589
Registration: 08.09.2003

Oh, well, I can use it, I understand how it works, but not inside(mathematics). In any case, thank You. I look like a fool, but I'm just learning at the age of 33:)


---------------------
Build ThreadBuild Thread
Message # 14 14.10.22 - 21:42:22
RE: JSFX real FFT (v5.25+)

HiMiles

usr


Statistics:
Messages: 14
Registration: 02.25.2003

Thanks a lot for the explanations. So the "Nyquist Frequency" has only to be considered with real FFT. Right now I am just doing the normal complex stuff, just to get some understanding of what is happening. But still I don't understand the point with the loop to set the real and imaginary part of the DC bin (with the complex FFT). Seemingly setting both ot zero or leaving them as they are does not harm unless the operation on the spectrum produces something unusable, anyhow. This also is the motivation for the tests with certain operations on the spectrum. I did not consider any optimization right now. An application I have in mind is "spectral subtraction". I will try to implement this once I feel I have enough understanding on the algorithms involved. -Michael



Message # 15 14.10.22 - 21:53:38
RE: JSFX real FFT (v5.25+)

LuxoM3

usr


Statistics:
Messages: 5,848
Registration: 03.05.2001

The Nyquist always exists, but with normal complex FFT, it's the last bin -- in its proper place. The "Nyquist" frequency is simply the highest possible frequency for your sample rate -- i.e half your sample rate. Such a waveform is constructed by alternating two sample points in oscillation; you can't go "faster" than this (because of your sampling rate). But, with normal complex FFT, it does have imaginary component, because the input is complex too. Even the DC has an imaginary component (which corresponds to the DC of the imaginary input). The reason it's stored weirdly with the real fft is again, because there's "no space" in the buffer otherwise. If the input is real, then both the DC and Nyquist have imaginary component set to 0, so it's not stored, so Nyquist's real value (only value that is stored) was placed where the DC had its imaginary component. As for your question about setting the DC to zero, yes I agree. I don't understand that code either. If you want to get rid of DC just set it to zero, but IMHO if you do "spectral processing" (on arbitrary input), you should treat DC properly for its magnitude (no phase though), with low overlap it may make a difference. You can set Nyquist to 0 if you don't want to bother processing it, it's probably inaudible, but I'm doing it "properly" because I'm a perfectionist. Anyway the Nyquist (last bin, highest frequency) being put in the first frequency's imaginary part is a "trick" used by real fft, it doesn't actually make any mathematical sense. So don't think too hard about it. :D (because mathematically, FFT is a complex-input, complex-output process, so real FFT itself is a 'trick')



Message # 16 14.10.22 - 21:57:04
RE: JSFX real FFT (v5.25+)

Mars

usr


Statistics:
Messages: 454
Registration: 04.06.2003

I think I understand. Thanks a lot for the explanation ! Now trying to find out how a frequency shift (e.g. doubling it) can be done by tweaking the spectrum. Supposedly my initial test handles phase in a wrong way (i.e: not at all) Thanks again, -Michael



Message # 17 14.10.22 - 22:05:34
RE: JSFX real FFT (v5.25+)
Sampletank plays back outta time : Previous topicNext topic: Hole in piston
Pages:  1  2  

The administrator has prohibited guests from replying to messages! To register, follow the link: register


Participants

Forum powered by: IP.Board © 2025 5.0.6