adcameron / ffancy

Software package for testing of the Fast Folding Algorithm (FFA)
MIT License
5 stars 1 forks source link

What's the periodic of the folding results? #1

Open desword opened 7 years ago

desword commented 7 years ago

Thanks for your code. I have one question that how to determine which periodicity belongs to my signal? For example, now I have test and get the folding sum distribution with periodic range from 0 to N. Then, how to determine which periodic is correct? According to the biggest folding sum peak that the periodic has?

For example, I have obtained three folding sum distribution with periodic (3, 4, 5), and distributions are [0:2, 1:5, 2: 10, 3:2 ], [0:2, 1:5, 2:8, 3:2, 4:2], [0:2, 1:5, 2:2, 3:2, 4:2, 5:4 ]. The tuple (x, y), where x means the phase and y means the sum. And the example maybe not practical, but I want to know is which periodic should I choose? Is it the periodic 3 because its corresponding distribution has the biggest folding sum 2:10 ? Thanks!

adcameron commented 7 years ago

Hey there, thanks for mailing.

I'm afraid I'm not sure of exactly what you're asking. Do you think you could send me some examples of the input/output your getting from ffancy, as well as the commands you are using to run it? That might help to make things clearer.

Cheers,

On Fri, Jul 14, 2017 at 10:05 AM, desword notifications@github.com wrote:

Thanks for your code. I have one question that how to determine which periodicity belongs to my signal? For example, now I have test and get the folding sum distribution with periodic range from 0 to N. Then, how to determine which periodic is correct? According to the biggest folding sum peak that the periodic has?

For example, I have obtained three folding sum distribution with periodic (3, 4, 5), and distributions are [0:2, 1:5, 2: 10, 3:2 ], [0:2, 1:5, 2:8, 3:2, 4:2], [0:2, 1:5, 2:2, 3:2, 4:2, 5:4 ]. The tuple (x, y), where x means the phase and y means the sum. And the example maybe not practical, but I want to know is which periodic should I choose? Is it the periodic 3 because its corresponding distribution has the biggest folding sum 2:10 ? Thanks!

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/adcameron/ffancy/issues/1, or mute the thread https://github.com/notifications/unsubscribe-auth/ANJCV7MqQEXeIWZ2UiQdivS9SbV7cgeZks5sNyFKgaJpZM4OX88w .

desword commented 7 years ago

Sorry for the late response. Actually, I haven't run this code successfully due to the compiling error. And I have tried to implement myself version of FFA using matlab.

I am asking how to determine the periodic according to the FFA results.

In my implementation, I first want to fold all the possible periodic, and then find the periodic with the highest folding sum. However, I find it is wrong. because any results that is the order of the correct periodic would be treated as the correct periodic. And the periodic would be one if I pick the periodic with the largest folding sum.

For example, the correct periodic is 120, however, when I fold the signal with periodic one, I will have the highest folding sum.

here is my matlab code. thanks

FFA_try.zip

desword commented 7 years ago

by the way, how to contact you conveniently? your email is invalid. acameronacameron@mpifr-bonn.mpg.de

adcameron commented 7 years ago

Thanks again for writing. This means of communication is alright, but if you wish to email me more directly, my address is indeed acameron@mpifr-bonn.mpg.de. That address should work just fine.

As for the FFA, I describe several methods of evaluating the results of the FFA in the paper I published ( http://adsabs.harvard.edu/abs/2017MNRAS.468.1994C). But to explain it again briefly:

Say you have a dataset that is N samples long, and there is a signal with period P samples hidden in that dataset. Running a single execution of the FFA will search from a period of P samples to P + 1 samples, and will output N/P folded signal profiles which have incremental periods between P and P+1. Note that the FFA works only when N/P = 2^x, so in order to search over any value of P, you have to modify your value of N slightly.

Now, the FFA only produces the folded profiles - it does not tell you which of those profiles contains the best signal. That is where you need something like a "Profile Evaluation Algorithm" which analyses these folded profiles and comes up with a number which can be treated like a S/N value for each profile. In my paper, I analyse two different techniques, labeled Algorithm 1 & 2.

I hope that helps. Have a read of the paper if you haven't already, and let me know if you have any other questions.

Cheers,

PS. What sort of compile error are you getting? Perhaps I can help.

On Sun, Jul 23, 2017 at 5:23 AM, desword notifications@github.com wrote:

by the way, how to contact you conveniently? your email is invalid. acameronacameron@mpifr-bonn.mpg.de

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/adcameron/ffancy/issues/1#issuecomment-317225978, or mute the thread https://github.com/notifications/unsubscribe-auth/ANJCV-wyh_7w_Uq9R1dWMI6by6366Qwvks5sQryYgaJpZM4OX88w .

desword commented 7 years ago

Thanks! I will deep into this paper.

Following is the error msg:

gcc -Wall -Werror -lm ffancy.o dataarray.o ffa.o ffadata.o mad.o metric1.o metric2.o metric3.o metric4.o metric5.o metric7.o metric8.o paddedarray.o power2resizer.o equalstrings.o whitenoise.o runningmedian.o -o ffancy ffancy.o: In function main': ffancy.c:(.text+0x97e): undefined reference topow' dataarray.o: In function basicPulsarDataArray': dataarray.c:(.text+0x62): undefined reference toceil' dataarray.o: In function readASCIIDataArray': dataarray.c:(.text+0x280): undefined reference toceil' dataarray.o: In function readFloatDataArray': dataarray.c:(.text+0x49b): undefined reference toceil' dataarray.o: In function readSIGPYPROCDataArray': dataarray.c:(.text+0x6ab): undefined reference toceil' dataarray.o: In function dereddenDataArray': dataarray.c:(.text+0xdd7): undefined reference toceil' ffa.o: In function massFFA': ffa.c:(.text+0x18a): undefined reference tofmod' ffa.c:(.text+0x220): undefined reference to pow' ffa.c:(.text+0x31d): undefined reference topow' ffa.o: In function singleFFA': ffa.c:(.text+0x63a): undefined reference tolog2' ffa.c:(.text+0x874): undefined reference to pow' ffa.c:(.text+0x8bc): undefined reference toceil' ffa.c:(.text+0x8df): undefined reference to floor' mad.o: In functionmad': mad.c:(.text+0xb5): undefined reference to floor' mad.o: In functiongetDeviances': mad.c:(.text+0x2de): undefined reference to floor' metric1.o: In functionpostMadMatchedFilterMetric': metric1.c:(.text+0x63): undefined reference to log2' metric1.c:(.text+0x7a): undefined reference toceil' metric1.c:(.text+0x20d): undefined reference to sqrt' metric1.c:(.text+0x24c): undefined reference tosqrt' metric2.o: In function kondratievMFMetric': metric2.c:(.text+0x63): undefined reference tolog2' metric2.c:(.text+0x7a): undefined reference to ceil' metric4.o: In functionmaxminMetric': metric4.c:(.text+0x1a7): undefined reference to pow' metric4.c:(.text+0x1dd): undefined reference tosqrt' metric5.o: In function kondratievMetric': metric5.c:(.text+0x110): undefined reference toceil' metric5.c:(.text+0x202): undefined reference to pow' metric5.c:(.text+0x238): undefined reference tosqrt' power2resizer.o: In function power2Resizer': power2resizer.c:(.text+0x1d): undefined reference tolog2' power2resizer.c:(.text+0x3c): undefined reference to ceil' power2resizer.c:(.text+0x66): undefined reference topow' whitenoise.o: In function generateWhiteNoise': whitenoise.c:(.text+0xbe): undefined reference tolog' whitenoise.c:(.text+0xcf): undefined reference to sqrt' whitenoise.c:(.text+0xea): undefined reference tocos' whitenoise.c:(.text+0x109): undefined reference to log' whitenoise.c:(.text+0x11a): undefined reference tosqrt' whitenoise.c:(.text+0x135): undefined reference to `sin' collect2: error: ld returned 1 exit status make: *** [ffancy] Error 1

Following is the version of GCC:

gcc -v Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.8/lto-wrapper Target: x86_64-linux-gnu Thread model: posix gcc version 4.8.4 (Ubuntu 4.8.4-2ubuntu1~14.04.3)

adcameron commented 7 years ago

Answering this on my phone, but at a guess: all the missing functions appear to be from math.h, which should be part of your GCC but apparently isn't. I'd double check that first.

Cheers,

-Andrew

On 31 Jul 2017 10:17 AM, "desword" notifications@github.com wrote:

Thanks! I will deep into this paper.

Following is the error msg:

gcc -Wall -Werror -lm ffancy.o dataarray.o ffa.o ffadata.o mad.o metric1.o metric2.o metric3.o metric4.o metric5.o metric7.o metric8.o paddedarray.o power2resizer.o equalstrings.o whitenoise.o runningmedian.o -o ffancy ffancy.o: In function main': ffancy.c:(.text+0x97e): undefined reference to pow' dataarray.o: In function basicPulsarDataArray': dataarray.c:(.text+0x62): undefined reference toceil' dataarray.o: In function readASCIIDataArray': dataarray.c:(.text+0x280): undefined reference toceil' dataarray.o: In function readFloatDataArray': dataarray.c:(.text+0x49b): undefined reference toceil' dataarray.o: In function readSIGPYPROCDataArray': dataarray.c:(.text+0x6ab): undefined reference toceil' dataarray.o: In function dereddenDataArray': dataarray.c:(.text+0xdd7): undefined reference toceil' ffa.o: In function massFFA': ffa.c:(.text+0x18a): undefined reference to fmod' ffa.c:(.text+0x220): undefined reference to pow' ffa.c:(.text+0x31d): undefined reference topow' ffa.o: In function singleFFA': ffa.c:(.text+0x63a): undefined reference to log2' ffa.c:(.text+0x874): undefined reference to pow' ffa.c:(.text+0x8bc): undefined reference toceil' ffa.c:(.text+0x8df): undefined reference to floor' mad.o: In functionmad': mad.c:(.text+0xb5): undefined reference to floor' mad.o: In function getDeviances': mad.c:(.text+0x2de): undefined reference to floor' metric1.o: In function postMadMatchedFilterMetric': metric1.c:(.text+0x63): undefined reference to log2' metric1.c:(.text+0x7a): undefined reference toceil' metric1.c:(.text+0x20d): undefined reference to sqrt' metric1.c:(.text+0x24c): undefined reference tosqrt' metric2.o: In function kondratievMFMetric': metric2.c:(.text+0x63): undefined reference tolog2' metric2.c:(.text+0x7a): undefined reference to ceil' metric4.o: In function maxminMetric': metric4.c:(.text+0x1a7): undefined reference to pow' metric4.c:(.text+0x1dd): undefined reference tosqrt' metric5.o: In function kondratievMetric': metric5.c:(.text+0x110): undefined reference toceil' metric5.c:(.text+0x202): undefined reference to pow' metric5.c:(.text+0x238): undefined reference tosqrt' power2resizer.o: In function power2Resizer': power2resizer.c:(.text+0x1d): undefined reference tolog2' power2resizer.c:(.text+0x3c): undefined reference to ceil' power2resizer.c:(.text+0x66): undefined reference topow' whitenoise.o: In function generateWhiteNoise': whitenoise.c:(.text+0xbe): undefined reference tolog' whitenoise.c:(.text+0xcf): undefined reference to sqrt' whitenoise.c:(.text+0xea): undefined reference tocos' whitenoise.c:(.text+0x109): undefined reference to log' whitenoise.c:(.text+0x11a): undefined reference tosqrt' whitenoise.c:(.text+0x135): undefined reference to `sin' collect2: error: ld returned 1 exit status make: *** [ffancy] Error 1

Following is the version of GCC:

gcc -v Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.8/lto-wrapper Target: x86_64-linux-gnu Thread model: posix gcc version 4.8.4 (Ubuntu 4.8.4-2ubuntu1~14.04.3)

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/adcameron/ffancy/issues/1#issuecomment-318999851, or mute the thread https://github.com/notifications/unsubscribe-auth/ANJCV43vrir-vsdhwInflZFONkvjJyE5ks5sTY2JgaJpZM4OX88w .