如何在Xcode中绘制Fftw?

如何在Xcode中绘制Fftw?,xcode,plot,fftw,Xcode,Plot,Fftw,我需要在我的应用程序中绘制Fftw的图形。我将结果(fft_结果[I][0]和fft_结果[I][1])保存在两个NSMutableArray中,并使用APLGraphView进行绘图。 我正在绘制原始数据,如下所示: [[weakSelf.graphViews objectAtIndex:kDeviceMotionGraphTypeUserAcceleration] addX:deviceMotion.userAcceleration.x y:deviceMotion.userAccelera

我需要在我的应用程序中绘制Fftw的图形。我将结果(fft_结果[I][0]和fft_结果[I][1])保存在两个NSMutableArray中,并使用APLGraphView进行绘图。 我正在绘制原始数据,如下所示:

[[weakSelf.graphViews objectAtIndex:kDeviceMotionGraphTypeUserAcceleration] addX:deviceMotion.userAcceleration.x y:deviceMotion.userAcceleration.y z:deviceMotion.userAcceleration.z];
[[weakSelf.graphViews objectAtIndex:kDeviceMotionGraphTypeFftwX] 
addX:fft_result[i][0] y:fft_result[i][1] z:4 ]; // fft_result[i][0] its for the Re-output, fft_result[i][1] for the Im-output and z=4 . its better than 0. So you can see the other values.
我想我也可以为fftw做这件事:

for( i = 0 ; i < SIZE ; i++ ) {
                    NSLog(@"FFTW-X [%d]: %f , %f ",i, fft_result[i][0], fft_result[i][1] );

                    fft_result[i][0]=[ arrayFftwX[i] floatValue];
                    fft_result[i][1]=[ arrayFftwXx[i] floatValue];
                    [[weakSelf.graphViews objectAtIndex:kDeviceMotionGraphTypeFftwX] addX:arrayFftwX[i] y:arrayFftwXx[i] z:0];
for(i=0;i
有人能帮帮我吗?非常感谢你的帮助


Magda

您的代码应该是这样的:

[[weakSelf.graphViews objectAtIndex:kDeviceMotionGraphTypeUserAcceleration] addX:deviceMotion.userAcceleration.x y:deviceMotion.userAcceleration.y z:deviceMotion.userAcceleration.z];
[[weakSelf.graphViews objectAtIndex:kDeviceMotionGraphTypeFftwX] 
addX:fft_result[i][0] y:fft_result[i][1] z:4 ]; // fft_result[i][0] its for the Re-output, fft_result[i][1] for the Im-output and z=4 . its better than 0. So you can see the other values.

不是xcode方面的专家,但您不应该分配给
ArrayFtWx
/
ArrayFtWxx
,而不是我假定分配给
fft\u结果的内容吗?