time_gate with multiplication in time domain
See original GitHub issueFor time gate skrf currently only supports convolution in frequency domain. In some cases it is more useful to multiply the gate in time domain.
The modification would be placed in time.py within the function time_gate and could be accessed by a new variable to switch between fd and td.
Code as optional path starting from line 300 … 312 in scikit-rf/skrf/time.py
out = ntwk.copy()
s_td = np.fft.ifft(out.s[:,0,0])
s_td_g = s_td * np.fft.ifftshift(gate)
s_fd_g = np.fft.fft(s_td_g)
out.s[:,0,0] = s_fd_g
Issue Analytics
- State:
- Created a year ago
- Comments:12 (4 by maintainers)
Top Results From Across the Web
skrf.time.time_gate — scikit-rf Documentation - Read the Docs
With 'fft' (default), the data gets transformed into time-domain using inverse FFT and the gating is achieved by multiplication with the time-domain gate....
Read more >(PDF) Gating effects in time domain transforms - ResearchGate
Time Gate shape for various gate center time choices ... Gating can be thought of as multiplying the time domain response by a...
Read more >Advanced Antenna Measurement Techniques using Time ...
Time domain data is obtained mathematically from frequency domain. Vector antenna responses in frequency domain can be transformed to time domain.
Read more >scikit-rf/time.py at master - GitHub
by multiplication with the time-domain gate. The gated time-domain signal is then transformed back into. frequency-domain using inverse FFT.
Read more >Multiplying Signals - University of California, Berkeley
We have seen that convolution in the time domain corresponds to multiplication in the frequency domain. It turns out that this relationship is...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
We have a winner! As expected, the time-domain multiplication is much faster than the frequency-domain convolution. And both results are nearly identical, so I think the choice is a no-brainer.
In the results below, I think the gating only works for $N>1000$ samples, hence the jump in the rms errors:
window=(‘tukey’, 0.66):
window=(‘kaiser’, 6):
Found two problems in the implementation of the frequency-domain gating:
the convolution with
mode='reflect'
caused significant boundary effects. Usingmode='wrap'
works betterthe frequency transform of the window was normalized in a strange way. Not sure what was going on there, but I think I found a much simpler and straight forward solution.
With the code below, both approaches now yield similar (identical?) results. I’ll do some more testing and then create a PR to fix this issue during the weekend.