Pregunta

Necesito trazar la gráfica de FFTW en mi solicitud.Ahorré el resultado (FFT_RESULT [I] [0] y FFT_RESULT [I] [1]) en dos NSMUTABLEARRY y estoy usando el AplGraphView para trazar. Estaba tramando los datos en bruto como este:

[[weakSelf.graphViews objectAtIndex:kDeviceMotionGraphTypeUserAcceleration] addX:deviceMotion.userAcceleration.x y:deviceMotion.userAcceleration.y z:deviceMotion.userAcceleration.z];

y pensé que podría hacerlo por el FFTW también:

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];

¿Alguien puede ayudarme aquí?Cada ayuda sería muy apreciada.

MAGDA

¿Fue útil?

Solución

Su código debe ser así:

[[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.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top