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 <andreiberce...@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! >