Oh, we will need a different implementation to support arrays as well as
the Frequencies abstract array. Thanks for reporting this issue, by the way!

--
João Felipe Santos


On Wed, Jul 2, 2014 at 1:38 PM, Andrei Berceanu <andreiberce...@gmail.com>
wrote:

> Ok, tnx :)
> But now `fftshift`, which before used to work, gives:
>
> > fftshift(DSP.fftfreq(10))
>
> type: circshift: in typeassert, expected Frequencies, got Array{Float64,1}
>
>
> in circshift at abstractarray.jl:417
>  in fftshift at dsp.jl:145
>
>
> On Wednesday, July 2, 2014 5:01:01 PM UTC+2, João Felipe Santos wrote:
>
>> Hi Andrei,
>>
>> you can use fftfreq in DSP.jl. The syntax is exactly the same as for your
>> function: http://dspjl.readthedocs.org/en/latest/util.html#fftfreq.
>>
>> Best
>>
>> --
>> João Felipe Santos
>>
>>
>> On Wed, Jul 2, 2014 at 9:28 AM, Andrei Berceanu <andreib...@gmail.com>
>> wrote:
>>
>>> I have written the following function to provide the same functionality
>>> as numpy's fftfreq (http://docs.scipy.org/doc/numpy/reference/generated/
>>> numpy.fft.fftfreq.html)
>>>
>>> ```
>>> function fftfreq(n::Int64, d::Float64)
>>>   N = fld(n-1,2)
>>>   p1 = [0:N]
>>>   p2 = [-fld(n,2):-1]
>>>   return [p1, p2]/(d*n)
>>> end
>>> ```
>>>
>>> From the response on https://github.com/JuliaLang/julia/issues/7317, I
>>> understand that such a function is already implemented in the DSP.jl
>>> package, perhaps using the immutable Frequencies?
>>> I am not quite sure how to use that though, could anyone please provide
>>> a concrete example which reproduces the use of fftfreq? Tnx!
>>>
>>
>>

Reply via email to