Author |
Topic |
|
huah2002
1 Posts |
Posted - 09/17/2022 : 08:10:40 AM
|
Hi,
I want to use the fft_amp function to analyze an oscillating signal. I am using Origin 2022 (64-bit) SR1.
I have tested the example in https://www.originlab.com/doc/en/OriginC/ref/fft_amp . I have compiled the code after typing 'Run.LoadOC("Originlab\fft_utils.c", 16)' in the command window. However, the Ampilitude column remains blank after I execute the fft_amp_ex2() function.
I would like to ask for some advice.
Thank you.
Here is the code from https://www.originlab.com/doc/en/OriginC/ref/fft_amp.
//Before running this example, import \\Samples\Signal Processing\fftfilter1.DAT to worksheet #include <fft_utils.h> void fft_amp_ex2() { Worksheet wks = Project.ActiveLayer(); if( wks ) { Column colX(wks, 0); Column colY(wks, 1); if( colX && colY ) { XYRange rng; rng.Add(wks, 0, "X"); rng.Add(wks, 1, "Y"); vector vX, vY; rng.GetData(vY, vX); int nSize = vX.GetSize(); // prepare frequcy and amilitide columns Column colFreq(wks, wks.AddCol()); colFreq.SetLongName("Frequency"); Column colAmp(wks, wks.AddCol()); colAmp.SetLongName("Ampilitude"); vector& vFreq = colFreq.GetDataObject(); vector& vAmp = colAmp.GetDataObject(); // to calculate frequcy and ampilitude fft_amp(vX, vY, vFreq, vAmp, nSize); // plot GraphPage gp; gp.Create("origin"); GraphLayer gl = gp.Layers(0); Curve cv(wks, colFreq.GetIndex(), colAmp.GetIndex()); gl.AddPlot(cv); gl.Rescale(); } } }
|
Edited by - huah2002 on 09/17/2022 08:35:48 AM |
|
minimax
351 Posts |
Posted - 10/09/2022 : 03:40:44 AM
|
Hi huah2002,
It is indeed a bug and we will get it fixed in the upcoming version, Origin 2023. (internal issue record is ORG-25788) |
|
|
|
Topic |
|
|
|