Open dds852456tw opened 6 months ago
Hi I found the solution below, but the result is string not array or another type, I referred to the test examples and did not find any suitable ones for process the complex.
octave
>> fft([1 2 3 4 5])
ans =
15.0000 + 0i -2.5000 + 3.4410i -2.5000 + 0.8123i -2.5000 - 0.8123i -2.5000 - 3.4410i
c#
FFT_Octave([0, 1, 2, 3, 4, 5]);
public static void FFT_Octave(double[] signal)
{
double fre, amp;
using (var octave = new OctaveContext())
{
string input = signal.ToOctave(); // [??????]
string cmd = "fft(" + input + ")";
var vectorResult = octave.Execute(cmd);
}
}
My requirement is to input a double array and then do FFT using Octave, but I don’t know how to give the input to Octave. by the way FFT output format is complex , can i use AsVector(); ??
public static void FFT_Octave(double[] signal) { double fre, amp;
}