DSPRelated.com
Forums

Convolution of symmetric data

Started by mpb May 21, 2009
bellda2005@cox.net wrote:
> On May 22, 3:00 pm, Jerry Avins <j...@ieee.org> wrote: >> bellda2...@cox.net wrote: >>> On May 22, 1:51 pm, Jerry Avins <j...@ieee.org> wrote: >>>> Steven G. Johnson wrote: >>>>> On May 21, 11:38 am, Jerry Avins <j...@ieee.org> wrote: >>>>>> Using symmetry replaces a multiplication with an addition and some >>>>>> overhead. If your processor has a hardware multiplier, that will >>>>>> probably slow the calculation. >>>>> That's not correct. Using symmetry (if done properly) can you a >>>>> factor of 2 in the number of multiplications and asymptotically a >>>>> factor of 2 in the number of additions, and a roughly a factor of 2 in >>>>> memory compared to an FFT for real data. An FFT specialized for real- >>>>> symmetric data is otherwise known as a fast discrete cosine transform >>>>> (DCT). >>>>> The trick is that you have to arrange your data so that the symmetry >>>>> is in the right form for a DCT, and there are 8 types of DCT >>>>> corresponding to 8 different symmetries. Wikipedia as a DCT article >>>>> with a figure that should help explain the different options you have >>>>> for the symmetry: >>>>> http://en.wikipedia.org/wiki/Discrete_cosine_transform >>>>> The original poster has symmetry that corresponds to a DCT-II, which >>>>> is why it is not giving the same result when he replaces it with the >>>>> symmetry corresponding to a DCT-I. (Both DCT I and II are supported >>>>> in FFTW.) >>>> Thanks for putting me straight. It occurred to me only this morning that >>>> the additions needed to combine the symmetric coefficients are recovered >>>> in the accumulation. How are the rest of the additions saved? >>>> Jerry >>>> -- >>>> Engineering is the art of making what you want from things you can get. >>>> &#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;- Hide quoted text - >>>> - Show quoted text - >>> For time domain convolution with one of the sequences being symmetric, >>> you save half (or half-1 if length of symmetric sequence is odd) the >>> multiplies and save none of the adds. >>> If both of the sequences are symmetric then the output of the >>> convolution is also symmetric, so the second half need not be >>> computed, and you end up with about half the original adds and about a >>> quarter of the original multiplies. >> Thanks. With convolution that otherwise takes no avccount of being >> doubly symmetric, one can still stop halfway through. >> >> Jerry >> -- >> Engineering is the art of making what you want from things you can get. >> &#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;- Hide quoted text - >> >> - Show quoted text - > > Do you mean and still get the complete result?
Half of a symmetric result suffices, I think. Jerry -- Engineering is the art of making what you want from things you can get. &#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;
On May 22, 3:39&#4294967295;pm, Jerry Avins <j...@ieee.org> wrote:
> bellda2...@cox.net wrote: > > On May 22, 3:00 pm, Jerry Avins <j...@ieee.org> wrote: > >> bellda2...@cox.net wrote: > >>> On May 22, 1:51 pm, Jerry Avins <j...@ieee.org> wrote: > >>>> Steven G. Johnson wrote: > >>>>> On May 21, 11:38 am, Jerry Avins <j...@ieee.org> wrote: > >>>>>> Using symmetry replaces a multiplication with an addition and some > >>>>>> overhead. If your processor has a hardware multiplier, that will > >>>>>> probably slow the calculation. > >>>>> That's not correct. &#4294967295;Using symmetry (if done properly) can you a > >>>>> factor of 2 in the number of multiplications and asymptotically a > >>>>> factor of 2 in the number of additions, and a roughly a factor of 2 in > >>>>> memory compared to an FFT for real data. &#4294967295; An FFT specialized for real- > >>>>> symmetric data is otherwise known as a fast discrete cosine transform > >>>>> (DCT). > >>>>> The trick is that you have to arrange your data so that the symmetry > >>>>> is in the right form for a DCT, and there are 8 types of DCT > >>>>> corresponding to 8 different symmetries. &#4294967295;Wikipedia as a DCT article > >>>>> with a figure that should help explain the different options you have > >>>>> for the symmetry: > >>>>> &#4294967295; &#4294967295;http://en.wikipedia.org/wiki/Discrete_cosine_transform > >>>>> The original poster has symmetry that corresponds to a DCT-II, which > >>>>> is why it is not giving the same result when he replaces it with the > >>>>> symmetry corresponding to a DCT-I. &#4294967295;(Both DCT I and II are supported > >>>>> in FFTW.) > >>>> Thanks for putting me straight. It occurred to me only this morning that > >>>> the additions needed to combine the symmetric coefficients are recovered > >>>> &#4294967295; in the accumulation. How are the rest of the additions saved? > >>>> Jerry > >>>> -- > >>>> Engineering is the art of making what you want from things you can get. > >>>> &#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;- Hide quoted text - > >>>> - Show quoted text - > >>> For time domain convolution with one of the sequences being symmetric, > >>> you save half (or half-1 if length of symmetric sequence is odd) the > >>> multiplies and save none of the adds. > >>> If both of the sequences are symmetric then the output of the > >>> convolution is also symmetric, so the second half need not be > >>> computed, and you end up with about half the original adds and about a > >>> quarter of the original multiplies. > >> Thanks. With convolution that otherwise takes no avccount of being > >> doubly symmetric, one can still stop halfway through. > > >> Jerry > >> -- > >> Engineering is the art of making what you want from things you can get. > >> &#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;- Hide quoted text - > > >> - Show quoted text - > > > Do you mean and still get the complete result? > > Half of a symmetric result suffices, I think. > > Jerry > -- > Engineering is the art of making what you want from things you can get. > &#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;- Hide quoted text - > > - Show quoted text -
If only one of the sequences is symmetric, the resulting convolution will not be symmetric. It takes both being symmetric to get the symmetric output so you can get the complete result while only completely computing about half of the results. Dirk
bellda2005@cox.net wrote:
> On May 22, 3:39 pm, Jerry Avins <j...@ieee.org> wrote: >> bellda2...@cox.net wrote: >>> On May 22, 3:00 pm, Jerry Avins <j...@ieee.org> wrote: >>>> bellda2...@cox.net wrote: >>>>> On May 22, 1:51 pm, Jerry Avins <j...@ieee.org> wrote: >>>>>> Steven G. Johnson wrote: >>>>>>> On May 21, 11:38 am, Jerry Avins <j...@ieee.org> wrote: >>>>>>>> Using symmetry replaces a multiplication with an addition and some >>>>>>>> overhead. If your processor has a hardware multiplier, that will >>>>>>>> probably slow the calculation. >>>>>>> That's not correct. Using symmetry (if done properly) can you a >>>>>>> factor of 2 in the number of multiplications and asymptotically a >>>>>>> factor of 2 in the number of additions, and a roughly a factor of 2 in >>>>>>> memory compared to an FFT for real data. An FFT specialized for real- >>>>>>> symmetric data is otherwise known as a fast discrete cosine transform >>>>>>> (DCT). >>>>>>> The trick is that you have to arrange your data so that the symmetry >>>>>>> is in the right form for a DCT, and there are 8 types of DCT >>>>>>> corresponding to 8 different symmetries. Wikipedia as a DCT article >>>>>>> with a figure that should help explain the different options you have >>>>>>> for the symmetry: >>>>>>> http://en.wikipedia.org/wiki/Discrete_cosine_transform >>>>>>> The original poster has symmetry that corresponds to a DCT-II, which >>>>>>> is why it is not giving the same result when he replaces it with the >>>>>>> symmetry corresponding to a DCT-I. (Both DCT I and II are supported >>>>>>> in FFTW.) >>>>>> Thanks for putting me straight. It occurred to me only this morning that >>>>>> the additions needed to combine the symmetric coefficients are recovered >>>>>> in the accumulation. How are the rest of the additions saved? >>>>>> Jerry >>>>>> -- >>>>>> Engineering is the art of making what you want from things you can get. >>>>>> &#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;- Hide quoted text - >>>>>> - Show quoted text - >>>>> For time domain convolution with one of the sequences being symmetric, >>>>> you save half (or half-1 if length of symmetric sequence is odd) the >>>>> multiplies and save none of the adds. >>>>> If both of the sequences are symmetric then the output of the >>>>> convolution is also symmetric, so the second half need not be >>>>> computed, and you end up with about half the original adds and about a >>>>> quarter of the original multiplies. >>>> Thanks. With convolution that otherwise takes no account of being >>>> doubly symmetric, one can still stop halfway through. >>>> Jerry >>>> -- >>>> Engineering is the art of making what you want from things you can get. >>>> &#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;- Hide quoted text - >>>> - Show quoted text - >>> Do you mean and still get the complete result? >> Half of a symmetric result suffices, I think. >> >> Jerry >> -- >> Engineering is the art of making what you want from things you can get. >> &#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;- Hide quoted text - >> >> - Show quoted text - > > If only one of the sequences is symmetric, the resulting convolution > will not be symmetric. It takes both being symmetric to get the > symmetric output so you can get the complete result while only > completely computing about half of the results.
I wrote "With convolution that otherwise takes no account of being *doubly* symmetric, one can still stop halfway through." By /otherwise/, I meant not modifying the computation. but also not forgetting the double symmetry. Jerry -- Engineering is the art of making what you want from things you can get. &#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;
On May 22, 7:59&#4294967295;pm, Jerry Avins <j...@ieee.org> wrote:
> bellda2...@cox.net wrote: > > On May 22, 3:39 pm, Jerry Avins <j...@ieee.org> wrote: > >> bellda2...@cox.net wrote: > >>> On May 22, 3:00 pm, Jerry Avins <j...@ieee.org> wrote: > >>>> bellda2...@cox.net wrote: > >>>>> On May 22, 1:51 pm, Jerry Avins <j...@ieee.org> wrote: > >>>>>> Steven G. Johnson wrote: > >>>>>>> On May 21, 11:38 am, Jerry Avins <j...@ieee.org> wrote: > >>>>>>>> Using symmetry replaces a multiplication with an addition and some > >>>>>>>> overhead. If your processor has a hardware multiplier, that will > >>>>>>>> probably slow the calculation. > >>>>>>> That's not correct. &#4294967295;Using symmetry (if done properly) can you a > >>>>>>> factor of 2 in the number of multiplications and asymptotically a > >>>>>>> factor of 2 in the number of additions, and a roughly a factor of 2 in > >>>>>>> memory compared to an FFT for real data. &#4294967295; An FFT specialized for real- > >>>>>>> symmetric data is otherwise known as a fast discrete cosine transform > >>>>>>> (DCT). > >>>>>>> The trick is that you have to arrange your data so that the symmetry > >>>>>>> is in the right form for a DCT, and there are 8 types of DCT > >>>>>>> corresponding to 8 different symmetries. &#4294967295;Wikipedia as a DCT article > >>>>>>> with a figure that should help explain the different options you have > >>>>>>> for the symmetry: > >>>>>>> &#4294967295; &#4294967295;http://en.wikipedia.org/wiki/Discrete_cosine_transform > >>>>>>> The original poster has symmetry that corresponds to a DCT-II, which > >>>>>>> is why it is not giving the same result when he replaces it with the > >>>>>>> symmetry corresponding to a DCT-I. &#4294967295;(Both DCT I and II are supported > >>>>>>> in FFTW.) > >>>>>> Thanks for putting me straight. It occurred to me only this morning that > >>>>>> the additions needed to combine the symmetric coefficients are recovered > >>>>>> &#4294967295; in the accumulation. How are the rest of the additions saved? > >>>>>> Jerry > >>>>>> -- > >>>>>> Engineering is the art of making what you want from things you can get. > >>>>>> &#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;- Hide quoted text - > >>>>>> - Show quoted text - > >>>>> For time domain convolution with one of the sequences being symmetric, > >>>>> you save half (or half-1 if length of symmetric sequence is odd) the > >>>>> multiplies and save none of the adds. > >>>>> If both of the sequences are symmetric then the output of the > >>>>> convolution is also symmetric, so the second half need not be > >>>>> computed, and you end up with about half the original adds and about a > >>>>> quarter of the original multiplies. > >>>> Thanks. With convolution that otherwise takes no account of being > >>>> doubly symmetric, one can still stop halfway through. > >>>> Jerry > >>>> -- > >>>> Engineering is the art of making what you want from things you can get. > >>>> &#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;- Hide quoted text - > >>>> - Show quoted text - > >>> Do you mean and still get the complete result? > >> Half of a symmetric result suffices, I think. > > >> Jerry > >> -- > >> Engineering is the art of making what you want from things you can get. > >> &#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;- Hide quoted text - > > >> - Show quoted text - > > > If only one of the sequences is symmetric, the resulting convolution > > will not be symmetric. &#4294967295;It takes both being symmetric to get the > > symmetric output so you can get the complete result while only > > completely computing about half of the results. > > &#4294967295; I wrote "With convolution that otherwise takes no account of being > *doubly* symmetric, one can still stop halfway through." > > By /otherwise/, I meant not modifying the computation. but also not > forgetting the double symmetry. > > Jerry > -- > Engineering is the art of making what you want from things you can get. > &#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;- Hide quoted text - > > - Show quoted text -
Got it. Agreed. Dirk
>On May 22, 7:59=A0pm, Jerry Avins <j...@ieee.org> wrote: >> bellda2...@cox.net wrote: >> > On May 22, 3:39 pm, Jerry Avins <j...@ieee.org> wrote: >> >> bellda2...@cox.net wrote: >> >>> On May 22, 3:00 pm, Jerry Avins <j...@ieee.org> wrote: >> >>>> bellda2...@cox.net wrote: >> >>>>> On May 22, 1:51 pm, Jerry Avins <j...@ieee.org> wrote: >> >>>>>> Steven G. Johnson wrote: >> >>>>>>> On May 21, 11:38 am, Jerry Avins <j...@ieee.org> wrote: >> >>>>>>>> Using symmetry replaces a multiplication with an addition and
so=
>me >> >>>>>>>> overhead. If your processor has a hardware multiplier, that
will
>> >>>>>>>> probably slow the calculation. >> >>>>>>> That's not correct. =A0Using symmetry (if done properly) can
you =
>a >> >>>>>>> factor of 2 in the number of multiplications and asymptotically
a
>> >>>>>>> factor of 2 in the number of additions, and a roughly a factor
of=
> 2 in >> >>>>>>> memory compared to an FFT for real data. =A0 An FFT specialized
f=
>or real- >> >>>>>>> symmetric data is otherwise known as a fast discrete cosine
trans=
>form >> >>>>>>> (DCT). >> >>>>>>> The trick is that you have to arrange your data so that the
symme=
>try >> >>>>>>> is in the right form for a DCT, and there are 8 types of DCT >> >>>>>>> corresponding to 8 different symmetries. =A0Wikipedia as a DCT
ar=
>ticle >> >>>>>>> with a figure that should help explain the different options
you =
>have >> >>>>>>> for the symmetry: >> >>>>>>> =A0 =A0http://en.wikipedia.org/wiki/Discrete_cosine_transform >> >>>>>>> The original poster has symmetry that corresponds to a DCT-II,
wh=
>ich >> >>>>>>> is why it is not giving the same result when he replaces it
with =
>the >> >>>>>>> symmetry corresponding to a DCT-I. =A0(Both DCT I and II are
supp=
>orted >> >>>>>>> in FFTW.) >> >>>>>> Thanks for putting me straight. It occurred to me only this
mornin=
>g that >> >>>>>> the additions needed to combine the symmetric coefficients are
rec=
>overed >> >>>>>> =A0 in the accumulation. How are the rest of the additions
saved?
>> >>>>>> Jerry >> >>>>>> -- >> >>>>>> Engineering is the art of making what you want from things you
can=
> get. >> >>>>>>
=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=
>=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF= >=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF-
H=
>ide quoted text - >> >>>>>> - Show quoted text - >> >>>>> For time domain convolution with one of the sequences being
symmetr=
>ic, >> >>>>> you save half (or half-1 if length of symmetric sequence is odd)
th=
>e >> >>>>> multiplies and save none of the adds. >> >>>>> If both of the sequences are symmetric then the output of the >> >>>>> convolution is also symmetric, so the second half need not be >> >>>>> computed, and you end up with about half the original adds and
abou=
>t a >> >>>>> quarter of the original multiplies. >> >>>> Thanks. With convolution that otherwise takes no account of being >> >>>> doubly symmetric, one can still stop halfway through. >> >>>> Jerry >> >>>> -- >> >>>> Engineering is the art of making what you want from things you can
g=
>et. >> >>>>
=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=
>=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF= >=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF-
H=
>ide quoted text - >> >>>> - Show quoted text - >> >>> Do you mean and still get the complete result? >> >> Half of a symmetric result suffices, I think. >> >> >> Jerry >> >> -- >> >> Engineering is the art of making what you want from things you can
get=
>. >> >>
=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=
>=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF= >=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF-
Hide=
> quoted text - >> >> >> - Show quoted text - >> >> > If only one of the sequences is symmetric, the resulting convolution >> > will not be symmetric. =A0It takes both being symmetric to get the >> > symmetric output so you can get the complete result while only >> > completely computing about half of the results. >> >> =A0 I wrote "With convolution that otherwise takes no account of being >> *doubly* symmetric, one can still stop halfway through." >> >> By /otherwise/, I meant not modifying the computation. but also not >> forgetting the double symmetry. >> >> Jerry >> -- >> Engineering is the art of making what you want from things you can
get.
>>
=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=
>=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF= >=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF- Hide
qu=
>oted text - >> >> - Show quoted text - > >Got it. Agreed. > >Dirk >
I am following the discussion and it was of help. From hat I follow is that if my data are symmetric I can stop the convolution halfway through as the result is also symmeric. Specifically take for example : a=[1 2 3 4 3 2 1] or [1 2 3 0 -3 -2 -1] b=[2 4 6 8 6 4 2] or [2 4 6 0 -6 -5 -3] depending on wether a and b are even/odd. Now in finding c=a*b by direct multiplication, I can stop halfway through as I know c will be either odd/even. Now, if I find c by using FFT, c=ifft(fft(a).*fft(b)) (after padding a and b to the size(a,b)*2-a places) there is NO WAY of stopping halfway through (correct me if I am wrong)! Or can I find ONLY HALF of the convolution using FFT? Why I am asking is that I have two convolve 2-D symmetric matrices with only few columns compared to rows and the matrices are SPARSE. Now, if find the convolution using DIRECT MULTIPLICATION but carefully selecting only the non-zero component (as there will be lot of zeros) and only half of the result (due to odd/even symmetry), it becomes faster than find the convolution by FFT (after zero padding though) as in FFT I neither have any option of selecting only the non-zero component nor only the half of the data (to use the symmetry). So, my question is that is there a way to make the FFT convolution faster or it's still advantageous to use direct multiplication?
On May 23, 11:21&#4294967295;pm, "mpb" <madhurjyap.b...@gmail.com> wrote:
> Why I am asking is that I have two convolve 2-D symmetric matrices with > only few columns compared to rows and the matrices are SPARSE. Now, if find > the convolution using DIRECT MULTIPLICATION but carefully selecting only > the non-zero component (as there will be lot of zeros) and only half of the > result (due to odd/even symmetry), it becomes faster than find the > convolution by FFT (after zero padding though) as in FFT I neither have any > option of selecting only the non-zero component nor only the half of the > data (to use the symmetry).
You have two separate questions here. First, can you take advantage of symmetry in an FFT? Yes, and the result is a fast discrete cosine transform, which only computes the non-redundant parts of the transform and saves roughly a factor of 2 compared to nonsymmetric data. Second, can you take advantage of some arbitrary sparsity in your data? Yes, this is called a "pruned FFT" (google it), but the gains in general are much smaller; it depends a lot on how much sparsity you have. Steven
>On May 23, 11:21=A0pm, "mpb" <madhurjyap.b...@gmail.com> wrote: >> Why I am asking is that I have two convolve 2-D symmetric matrices
with
>> only few columns compared to rows and the matrices are SPARSE. Now, if
fi=
>nd >> the convolution using DIRECT MULTIPLICATION but carefully selecting
only
>> the non-zero component (as there will be lot of zeros) and only half of
t=
>he >> result (due to odd/even symmetry), it becomes faster than find the >> convolution by FFT (after zero padding though) as in FFT I neither have
a=
>ny >> option of selecting only the non-zero component nor only the half of
the
>> data (to use the symmetry). > >You have two separate questions here. > >First, can you take advantage of symmetry in an FFT? Yes, and the >result is a fast discrete cosine transform, which only computes the >non-redundant parts of the transform and saves roughly a factor of 2 >compared to nonsymmetric data. > >Second, can you take advantage of some arbitrary sparsity in your >data? Yes, this is called a "pruned FFT" (google it), but the gains >in general are much smaller; it depends a lot on how much sparsity you >have. > >Steven >
Yes, you're right. I am just thinking the ways to make the convolution faster : (i) by using the symmetry either by using DST or DCT and (ii) by using non-redundant component of the FFT (pruned FFT) However, pruned FFT may not yield much (but I have 2-d convolution, so it might). Then I was planning to use FFTW or DCT ad DST, but the FFTW does then DST/DCT by pre- and post-processing FFT, not a pure DST/DCT, so it's actually slower than doing FFT. Can you suggest any DST/DCT (2-D) routines, which natively computes the DST/DCT? The time factor is very serious in my case as I am finding these convolutions as a part of a simulation, which will probably evaluate these convolution some million times. So saving time, if it can be, worth trying. I have not yet tried pruned FFT though! ---Madhurjya
On May 25, 7:34 am, "mpb" <madhurjyap.b...@gmail.com> wrote:
> ... > but the FFTW does > then DST/DCT by pre- and post-processing FFT, not a pure DST/DCT, so it's > actually slower than doing FFT. > ... > ---Madhurjya
The size of the FFT performed inside the DCT implementation is smaller than the original symmetric data set. It processes only a non- redundant subset of the original data and is therefore faster than a direct FFT on the symmetric data set despite the pre- and post- processing. Dale B. Dalrymple
mpb schrieb:
> I have to convolute two sets of symmetric data which are zero centered > i.e. > > c=a*b where for example > > a=[1 2 3 4 5 4 3 2 1] > b=[2 4 6 8 10 8 6 4 2]
How large are your vectors? I would assume that an optimized (SIMD) direct convolution is faster than black magic based on FFTW if the vector size is smaller than ~50. The result will also be symmetric, so you would only need to calculate one half of it. Hendrik vdH