Page 1 of 1
Turn off warning
Posted: Sun Aug 16, 2009 8:46 pm
I'm trying to use the qtvwave library to build a simple mex C function to calculate Rayleigh wave ellipticity. As Marc suggested in another post, I started playing with the gpell code and after some copy, paste and modify, now the code is somehow running.
However I get a segmentation fault in all those particular cases where gpell produces some warning (e.g. ** Warning ** : _x2 == min). In all other cases it works well.
I'm still not 100% sure this can cause the problem but, just in case, is there any automatic way to suppress these warnings and any console output?
Posted: Sat Oct 17, 2009 2:58 am
In latest release the warning is either fixed or it does not produce any crash. For your information, in the next release qtbwave library has been renamed to GpCoreWave. Among other reasons I wanted to get rid of prefix 'Qtb' which means nothing and prefer using namespace. Porting from one version to the other is really not a big deal (just a few replacements).
I can't remember if there was a C and a Fortran interface to that library at the time you implement your mex function. Now, there is a C interface to the computation of dispersion and ellipticity curves.
Thanks for the code.
Posted: Sat Oct 17, 2009 3:07 am
Reading your code, I do not understand exactly what your are doing. Are you calculating the curve for two samples only? Why not setting the number of samples in the argument of the function?
On the output, what do you expect? One single value? Or a complete vector containing the ellipticity curve? Do you know to return a vector to Matlab? And how to accept a vector, for instance the sampling vector?
Posted: Sat Oct 17, 2009 4:14 pm
Thanks for the reply.
Yes, I know this code could appear a little awful...
but this was the last of a long series of tests were I changed a lot of stuff, and the interface has been generally defined for testing purposes only (so, it is not optimized at all). Of course the Mex final interface would have been better written ;-p
The idea was just of getting one unique output value out of one unique frequency. Unfortunately, I can't make it working even in this simple case.
Anyway, now that I know about the new C interface, I will use it.
Thanks once again!
Posted: Sat Oct 17, 2009 5:30 pm
Just a remark to get one single frequency point in the ellipticity curve.
If the sampling is rather poor it is likely to produce very bad results. To compute an ellipticity curve it is necessary to first compute the dispersion curve which requires a large band to allow automatic validity tests. So the best solution if you want just one point, let's say at 1 Hz, is to add samples before and after: e.g. 25 samples from 0.1Hz to 1Hz and other 25 from 1Hz to 10 Hz. Do the computation and return only the 26th value located at 1Hz.