|
From: | Prasanth N P |
Subject: | Re: Want to know how to inluce octave fft lib in my Qt program |
Date: | Thu, 10 Oct 2013 14:59:30 +0530 |
Hi,
Please do not top post, i.e., add your replies to the end of the message
instead of the top as it makes it easier for others to follow the conversations.
>>> On 7 Oct 2013, at 08:40, Prasanth N P <address@hidden> wrote:
>>>
>>> > Hi,
>>> > Hi,
>>> > I want to know how to use the fft function in octave in my qt program. Currenly I have a set of samples and want to do the fft of these with octave fft function. How can I do this?
>>> --
>>> Thanks & Regards,
>>> Prasanth NP
>>
>> Octave's fft function is just a wrapper for the fftw library [1],
>> so if you have a C/C++ program it's probably easier for you to
>> use fftw directly.
>>
>> HTH,
>> c.
>>
>> [1] http://www.fftw.org/
>>
>>
> On 9 Oct 2013, at 10:23, Prasanth N P <address@hidden> wrote:
>
> But i have to use the ellip filter too in this case, If I use the seperate lib of fftw, I have to find the seperate filter function also. So it is better to use the octave lib. Here is my problem
>
> I have to use those computation in my qt program. But currently I made this through system call
>
> myprogram.cpp
>
> system("octave -qf shellLof.m");
>
>
> shellLof.m
>
> load 'Data'
> setenv ("GNUTERM", "x11")
> t=1/SF;
> l=2048;
> v=fft(Data,l)/l;
> V = v(1:l/2);
>
> save fftdata V;
>
>
> Finally 'fftdata' file loaded in the myprogram.cpp. Can I use the fft function of octave without calling this shell program?
> --Yes,
> Thanks & Regards,
> Prasanth NP
you can use the function "feval" to invoke the Octave interpreter from within a C++ application,
there is an exemple of how to do this inside the Octave source tree, look for the file named
examples/embedded.cc
HTH,
c.
[Prev in Thread] | Current Thread | [Next in Thread] |