Bringing this back to gonum-dev.
https://groups.google.com/d/topic/gonum-dev/iGeEn43k9H4/discussion
Comments in-line.
On Thu, 2018-08-16 at 16:37 -0700, William Cotton wrote:
> I do not have any feel for where the discussion is most appropriate,
> just
> following guidance of y'all.
Yeah, no worries.
> Re performance claims, micro bench in
zikichombo.org/dsp/fft is a
> start
> with go test -bench. If you look at the constants, for real_test.go
> and
> t_test.go you will see they are for the same problem size. A real
> interface which just puts float64s in the complex128s would just add
> to the
> cost of the t_test.go.
>
> Although not exactly measuring what happens or would happen in gonum
> fft,
> it is at least a point of reference.
Because of the differences in implementation the performance
characteristics of the approaches need to be assessed. The cost of a
copy from float64 to the real part of complex128 is likely to be very
minor when compared to the cost of the transform operation, but this
assertion is why there needs to be a comparison.
Can you explain to me what the difference between the half complex and
the real FFT is in your package?
> Unfortunately, I am not familiar with FFTPACK implementations, so we
> have
> some disjointness in our points of reference to consider in the
> discussion.
Yes, that's why we're having this discussion.
> That said, it sounds like you took my comment about relations
> between HC
> MDCT and FFT roughly as intended (intensions being based on perusal
> of FFTW
> and relevant MDCT/DCTIV relations)
If you are prepared to do some initial work on what that would entail,
I'm happy to pick up the work when I have time. Otherwise feel free to
send a PR adding MDCT to either or both of fourier and internal/fftpack
(where I think we would be better off starting for efficiency of
operation's sake).
> Apologies, I did not understand anything regarding your point about
> interfaces and docs and examples. Perhaps we could back up and try
I suspect you are using the term interface in the more general sense
(the I in API), rather than the Go type sense (type I interface {...),
since there does not appear to be a commonality of methods between the
difference concrete types. Maybe I'm misunderstanding here.
> to
> re-sync the topic. I found the spectra functionality in
>
zc.org/dsp/fft
> useful but of course it is also too audio specific for gonum to
> prioritise. Just thought maybe there were some aspects you might
> like,
> such as not using fftshift, "FoldReal". I guess gonum might have
> fancier
> ways of interpolating the peaks, but what zc has works well for
> audio.
I guess what I'd like to see is some examples of use. The method names
in zikichombo's dsp packages are pretty terse and documentation is
sparse, so getting a feel of how to use it is non-trivial.
> On a larger note, I find the "standard" dsp libraries like Matlab etc
> often
> have implicitly broken APIs, such as fftshift. But they have become
> so
> standard that people start to think of them as "mathematical" ideas
> just
> because they are an artefact of matlab. Maybe I'm just too much an
> oddball
> in this respect, and that's fine, but I thought it worth voicing this
> anyway. Feel free to ignore.
Opinions are not ignored, but may be disagreed with. The ShiftIdx
operation could be renamed as CenteredIdx (though that would likely
reduce the readability of the API in the case of the gonum package),
but it's as mathematically inappropriate as PCA. The justification of
centring is that it's multiply useful (the centring operation has uses
in image processing as well as as a basis for folding, which is merely
an additional operation on top of that). This is a case of less is
more; we have very few methods, but they can be composed in such a way
that multiple uses are possible. There is certainly a case for thinking
about adding a dsputils (or better named) package that does some of the
operation that zikichombo has based on the fourier package's base
types. Your guidance in that direction would be very helpful.
Dan
>
> On 17 August 2018 at 00:43, Dan Kortschak <
notifi...@github.com>
> wrote:
>
> >
> > I think this discussion is still at the level of what should be
> > happening
> > at gonum-dev. Until there's a reasonable set of concrete proposals
> > can we
> > keep it there. There is a lot here to take in.
> >
> > Some of the things here need to be addressed though to avoid being
> > lost.
> >
> > What I will say though is that there is a general approach in Gonum
> > to not
> > overly specialise implementations to any particular field, doing so
> > reduces
> > flexibility and usability in others. We follow the *Do less. Enable
> > more*
> > <
https://blog.golang.org/open-source> axiom that is ingrained in Go
> > practice. A frequency type appears to do to much to me.
> >
> > I would like to keep the reduced input length restrictions we have
> > (FFTPACK does not require even length input and this is the basis
> > for our
> > code).
> >
> > I'm not sure of the interface argument, there are commonly named
> > methods
> > in the dsp packages, but they cannot be an interface as they take
> > different
> > types. So I'm not entirely sure how that would work. Maybe some
> > examples or
> > extended documentation in dsp would help here.
> >
> > To that end, and the performance claims, it would be good to see
> > some
> > benchmark comparisons (both to see difference in use and perf). I
> > doubt the
> > inplaceness of the operations is a significant contributor to the
> > cost of
> > them, but that is something that can be addressed by doing some
> > rework on
> > the internal package.
> >
> > What I take from the comment above is a desire for MDCT (which we
> > can get
> > from the FFT code that we have) and the HalfComplex (which we can
> > probably
> > derive reasonably easily from the complex FFT code that we have).
> >
> > —
> > You are receiving this because you authored the thread.
> > Reply to this email directly, view it on GitHub
> > <
https://github.com/gonum/gonum/issues/569#issuecomment-413706233>,
> > or mute
> > the thread
> > <
https://github.com/notifications/unsubscribe-auth/ASR014Pe_PgeGMm3
> > UwlNzoDJwwoD7Dvhks5uRfWCgaJpZM4V5KWA>
> > .
> >
>
>
> --
> Scott Cotton
> President, IRI France SAS
>
http://www.iri-labs.com
>
>