Re: why we want to do folding while performing convolution



jim wrote:
Andor wrote:

jim wrote:
Andor wrote:


That's true. But choosing the center of the kernel as zero-index can
only be done for kernels of an odd size ...

Well, not really. If you limit your indexing capability to whole
integers then you are saddled with that limitation (in other words, if
you require your reference zero to land on a sample point only odd sized
kernels will be allowed). But there is no mathematical reason preventing
you from setting zero to half way between two samples.

Interesting. Let's say you have a first order difference filter (two
coefficients). How does a symmetric indexing scheme work with this
filter?


First of all as you stated in the first post that I replied to, the
shift theorem tells you how much to shift to eliminate the linear phase
term, so you should be able to work it out from that alone.

The shift theorem works only for integer shifts. For non-integer shifts
periodic interpolation in time-domain is performed. This does not
result in the same filter as with bandlimited interpolation. For
example, the first difference filter h = [1 -1] using a shift of 1/2
results in the zero filter (h[k] = cos(2 pi k) => h[k+1/2] = cos(2 pi
(k+1/2)) = 0). Contrast this to bandlimited interpolation of h when
shifted by 1/2 which results in the two-sided antisymmetric IIR filter

h_{1/2} = [ ... -0.339531, 0.848826, 0, -0.848826, 0.339531, .... ]


Remember,
The indices themselves are shifts and the entire kernel can be
decomposed into single shifted impulses. If instead you choose to
decompose into symmetrical and anti symmetrical parts then each part is
composed of matched pairs of impulses where the distance between is
increasing by 2.

For computing the frequency response for kernel of length N that can be
boiled down to this:

For a odd length filter -> sum of sines and cosines with even multiples
of Pi (0, 2, 4, ... N-1)

For a even length filter -> sum of sines and cosines with odd multiples
of Pi (1, 3, 5, ... N-1)



So if your filter was [3 -1]. That decomposes to [1 1] and [2 -2]

and thus the frequency response is cos(pi) + 2*sin(pi)

I'm not quite sure where you are going with your calculation. The
frequency response of the filter [3 -1] is

H(w) = 3 - exp(-j w),

and its magnitude squared response is

|H(w)|^2 = 10 - 6 cos(w).

I don't see how your formula can be turned into either of those.
Anycase, we were discussing the frequency domain equivalent of
time-reversing the filter kernel. It is easy to show in this example
how time-reversion implies conjugation of the frequency response and
the multiplication of the linear-phase term corresponding to a time
shift:

H_r(w) = -1 + 3 exp(-j w) = exp(-j w) (- exp(j w) + 3) = exp(-j w)
H(w)*

Regards,
Andor

.



Relevant Pages

  • Re: why we want to do folding while performing convolution
    ... only be done for kernels of an odd size ... ... Let's say you have a first order difference filter (two ... shift theorem tells you how much to shift to eliminate the linear phase ... The indices themselves are shifts and the entire kernel can be ...
    (comp.dsp)
  • Re: Any GIMP users (Linux)
    ... kernel proportional to the reduction factor. ... downsampling needs an 8x8 kernel, 3X downsampling needs 12x12, etc). ... expensive filter like Lanczos. ... What downsampling filter does ImageMagick use? ...
    (rec.photo.digital)
  • Re: Packets from bottom of TCP/IP stack direct to application bypassing stack
    ... >> your own filter modules. ... > either of the pcap but since it is a lib and not part of the kernel I feel ... The netfilter part of the kernel is designed to do exactly what you want. ... character device and readout the packets which meet your requirements. ...
    (comp.os.linux.embedded)
  • Re: DirectKS and DirectX
    ... I've never been entirely clear on the separation between kernel and user ... mode devices. ... "Iain" wrote in message ... Connecting a source filter ...
    (microsoft.public.win32.programmer.directx.audio)
  • Re: Cannot ssh to OpenSolaris after upgrade to 2008.11 (build 101) from WinXP
    ... thought it was an issue with my PC, but if I revert the kernel back to ... That's what so odd. ... server, which is different from timeout, no? ... I only get that error msg when the client times out. ...
    (comp.security.ssh)