LabWindows/CVI

取消
显示结果 
搜索替代 
您的意思是: 

General protection faul

HI,

 

I'm using the AmpPhaseSpectrum function and i don't know how it works exactly. For instance, i don't understand what i have to pass in the 'df' parametre (expected to be a double in the recall function panel but a pointer to double in function help), is this an output? I'm not really sure... :s

Moreover, when i run the code, at the line of this function, the code stops and it is said : The program has caused a 'Genereal protection' fault at... What does it mean?

 

 

Supplementary question with no link with above :

I want to compute the module of a complex number. I use two local variables : a and b. Respectively the real and imaginary part. Then I compute : sqrt(a*a+b*b). The error seems to be that a*a+b*b is not a positive number (error==33(0x21) EDOM domain error). Did i miss something? 

 

Thanks,

 

 

_trent_

0 项奖励
1 条消息(共 3 条)
3,021 次查看

Hi,

 

In the df parameter you have to pass a double by its reference, this way you will change the value of df in the AmpPhaseSpectrum function, it's like an output yes.

 

May be you have the error 'General protection' because you didn't check the number of elements in the arrays you pass in parameters "Amplitude Spectrum" and "Phase Spectrum" that should be numberOfElements/2 at least as described in the help of each parameter.

 

c = sqrt(a*a+b*b); is correct, what are the values of a & b ?

 

Regards


0 项奖励
2 条消息(共 3 条)
3,006 次查看

Ok, I fixed my issue with df.

About the sqrt: I used ReFFT (or FFtTex whatever) to compute the FFT of a signal. I get the reel part in a[i] and the imaginary part in b[i]. But i don't exactly know what there is in those variables.

 

And thank you for your answers

0 项奖励
3 条消息(共 3 条)
3,003 次查看