> Date: Thu, 24 Aug 2000 10:02:08 +0200
> From: "Jürgen v.Hagen"
> robin wrote:
> >
> > > For some filtering of matrices I need to act on the real and the
> > > imaginary part seperately (the filter is real). For now, I
> > > copy the real (and imaginary) part into a temporary matrix, and
> > > act on these like:
> > > temp(1:N,1:N) = real(mat(1:N,1:N)
> > > call filter(filtercoefs, temp)
> > > erg(1:N,1:N) = temp(1:N,1:N)
> > >
> > > temp(1:N,1:N) = real(mat(1:N,1:N)
> > > call filter(filtercoefs, temp)
> > > erg(1:N,1:N) = erg(1:N,1:N) + cmplx(0.0, temp(1:N,1:N))
> >
> > Have you considered duplicaing the filter to work on the
> > real and the imaginary parts?
> >
>
> the filters are for real and imaginary the same. However, I thought that
> you'd save quite a few operations if you work only on real and the
> imaginary part seperatly.
>
> mat is complex, filter is real, so a multiplication promotes the filter
> to complex, meaning that you'd need 4 multiplies and 2 adds, whereas
> you really only need 2 multiplies.
You'd need to prepare versions appropriate to the real and the
imagnary parts as separate computations. It would require no more
arithmetic operations than would be required with separate calls.
> juergen
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|