jurihock / sdft

Single file forward and inverse Sliding DFT in C, C++ and Python
MIT License
19 stars 4 forks source link

Improvements to the Sliding Discrete Fourier Transform Algorithm (kSDFT) #5

Open jurihock opened 1 year ago

jurihock commented 1 year ago

kSDFT

A modulated SDFT network was presented in [mSDFT, Fig. 3]. That network frequency translates the N-delay comb stage’s output spectral energy, originally centered at kfs /N Hz, down to 0 Hz and implements a complex resonator where exact pole/zero cancellation occurs at z = 1 on the z-plane. Although that network is guaranteed stable, it is less computationally efficient than is our proposed SDFT network in Figure 3.

jurihock commented 1 year ago

kSDFT

image

mSDFT

image
jurihock commented 1 year ago

BTW: An Efficient Full-Band Sliding DFT Spectrum Analyzer as extension of oSDFT for real-valued input

Statement:

Two surprising properties of both Figure 1 networks are: 1) although they use recursive complex multiplications the networks are guaranteed stable, and 2) the networks compute sliding DFT samples without a comb delay-line section required by traditional sliding DFT networks!

Comment:

I have no experience in OFDM processing, but if your OFDM processing requires you to compute all N output spectral samples of an N-point DFT in real time then one of the networks in this blog’s Figure 1 should achieve your goal.   If your OFDM processing requires you to compute, say 8, real time N-point DFT spectral samples (where N is greater than 8) then you merely need to implement 8 sliding DFT networks. That is, one comb section driving 8 separate resonator sections.

Would be a great opportunity to ask Rick about a logarithmic frequency resolution extension on April 1...

jurihock commented 1 year ago

Summary of findings:

My conclusions so far:

Thoughts:

jurihock commented 1 year ago

oSDFT2

The oSDFT2 is somehow faster than mSDFT (it's hard to verify it in python). On the other side, it seems to produce an artefact in the analysis.py example right at the beginning of the sequence. But except of this area, the estimated spectrogram looks pretty decent (no idea what's about the phase).

image

jurihock commented 1 year ago

kSDFT (C++)

The C++ kSDFT implementation seems to be nearly as fast as the current mSDFT.

Benchmark:

Measurements:

It's true, the kSDFT has less mults, but more adds and a larger delay line.

Also the kSDFT seems to produce strange artefacts, which I did not observe in mSDFT. Maybe there is still a twiddle computation bug, but the benchmark measurements should be correct.

jurihock commented 1 year ago

oSDFT2 (C++)

Benchmark:

Measurements:

Probably I'll keep both mSDFT (as default implementation) and oSDFT2 (C++ only)...

jurihock commented 1 year ago

Recent blog post by Rick introduces A Fast Guaranteed-Stable Sliding DFT Algorithm.

Where reference [3] is the mSDFT.

Conclusion:

See also fast_sdft_response.py