help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Want to know how to inluce octave fft lib in my Qt program


From: Prasanth N P
Subject: Re: Want to know how to inluce octave fft lib in my Qt program
Date: Tue, 22 Oct 2013 09:15:29 +0530




On Mon, Oct 21, 2013 at 7:16 PM, c. <address@hidden> wrote:

On 21 Oct 2013, at 12:46, Prasanth N P <address@hidden> wrote:

> Thank you for your cooperation. But when executed it shows errors
>
> error: feval: function `fft' not found
> error: octave_base_value::array_value(): wrong type argument `<unknown type>'

Have you initialized the interpreter as in the embedded.cc example?
Does "fft" work from you from the Octave prompt?

c.



Yes, fft works fine in my octave promt. Here is my complete program

#include <iostream>
#include </usr/include/octave-3.2.4/octave/oct.h>
#include </usr/include/octave-3.2.4/octave/octave.h>
#include </usr/include/octave-3.2.4/octave/parse.h>
#include </usr/include/octave-3.2.4/octave/oct-fftw.h>


int main (void)
{

  string_vector argv (2);
  argv(0) = "embedded";
  argv(1) = "-q";
  int InData[1024],ucI;
  

  ColumnVector input_vector (1024, 0.0);



  FILE *fp;

  fp = fopen("buffer","r");
  if (fp == NULL)
  return 0;
  
  for (ucI=0; ucI< 1024; ucI++)
    fscanf(fp, "%d\n", input_vector.fortran_vec () + ucI);

  fclose(fp);



  octave_value_list input;
  input(0) = input_vector;
  
  octave_value_list output = feval ("fft", input, 1);
  
  ColumnVector output_vector = output(0).column_vector_value ();
  
    
  
  for (ucI=0; ucI< 1024; ucI++)
     std::cout << output_vector.fortran_vec ()[ucI];



  return 0;
}


reply via email to

[Prev in Thread] Current Thread [Next in Thread]