[SciPy-Dev] discrete sine transforms

Matt Terry matt.terry at gmail.com
Mon Dec 5 23:55:28 EST 2011


>> >>> Hi,
>> >>> I noticed that scipy.fftpack has discrete cosine transforms, but not
>> >>> sine transforms.  It also looks like the dst's are in the fftpack
>> >>> source, just not the scipy wrappers.  Is there a special reason for
>> >>> not wrapping the dst's, or do they just lack a champion?
>> >>
>> >>
>> >>
>> >> There's a ticket for that:  http://projects.scipy.org/scipy/ticket/1432
>> >>
>> >> I don't see any reason for not making dst available.  I suspect it just
>> >> hasn't been a top priority for anybody.  A pull request would be great,
>> >> if
>> >> anyone wants to implement this.
>> >>
>> >> Warren
>> >
>> > Sounds good.  I should have something working and tested this weekend.
>> >
>> > -matt
>>
>> I have the wrappers written and mostly tested.  I have a question for
>> those that use fft's more than I.
>>
>> Often when people refer to "the DCT", they mean the type-2 DCT.  Is
>> there any such convention for the DST?  My inclination is to make the
>> default DST type to be the one with boundary conditions most like
>> default DCT (type-2 DST).  However, Matlab only implements the type-1
>> and for my particular use, the type-1 is most useful.  Any thoughts on
>> what the default type of scipy.fftpack.dst should be?
>>
> For consistency I'd think it should match the dct implementation:
> http://docs.scipy.org/doc/scipy/reference/generated/scipy.fftpack.dct.html.
> So type 2 as default.
>
> Ralf

That is my leaning also.  For what it is worth, Matlab's dst uses
type-1, but Mathematica's FourierDST defaults to type-2.  FFTW is
silent on the matter.

-matt



More information about the SciPy-Dev mailing list