Comments (4)
Tried the default example from calcnaff and got the same phases each time. Also tried it on some BPM data. I couldn't repeat the problem for AT2.0. nafflib.c revision date 25/7/2017.
You can use it for just real signals and the phases be also be correct (taking only the positive frequencies). However for the amplitude you have to sum the positive and negative frequency amplitudes to get it right. Or you can simply multiply by a factor of 2 if the frequency is not zero or fs/2.
from at.
Dear @carmignani,
I cannot reproduced your bug.
If you run the nafflib algorithm with a real signal, its works well for me.
This is a simple example :
t = linspace(1,2pi20,1000);
[frequency amplitude phase] = nafflib(sin(t),sin(t)0, 1, 5, 1)
*** NAFF results ***
NFS = 2
AMPL= 4.207309e-01+i 2.701499e-01 abs(AMPL)= 4.999955e-01 arg(AMPL)= 5.707992e-01 FREQ=-1.247885e-01
AMPL= 4.207355e-01+i*-2.701512e-01 abs(AMPL)= 5.000000e-01 arg(AMPL)=-5.707963e-01 FREQ= 1.247885e-01
The phase is stable and the amplitude of each harmonic is 0.5 as expected.
from at.
Nevertheless, I suspect something wrong the in the c-library, since sometimes, the function returns NaNs for valid input signal.
If I rerun again the same command with the same input argument the results is then fine.
I suspect something not properly defined with the dynamic memory allocation in the code.
I need to run the code in debugger to understand. This is quite annoying and time consuming to debug.
Any advice is very welcome.
from at.
I get exactly the same output running the example you wrote, but if I run it many times sometimes I get nans.
I also suspect there are some problems in the dynamic memory allocation in the C code.
from at.
Related Issues (20)
- Frequency map with PyNAFF and patpass HOT 1
- wrong tune in atplot when lattice contains an IdTablePass (matlab) HOT 9
- lattice_pass modifies initial coordinates HOT 2
- lattice operators: function and documentation HOT 1
- pyat get_lifetime modifies the given refpts HOT 8
- atreforbit and rotation errors HOT 1
- Merging pull requests HOT 8
- AT does not compile with OpenMP=1 HOT 6
- atreduce transforms rbend in sbend HOT 3
- regular expression instead of fnmatch? HOT 15
- Observables and variables HOT 2
- get_unit32_index , get_bool_index names? HOT 12
- include fast_ring generation from a list of machine parameters (tunes, chromaticities, ac, U0, etc) HOT 5
- plot_beta help HOT 1
- plot_beta does not seem to have an option to display magnets names/indexes HOT 2
- modification to get_lifetime HOT 3
- atm2html not working HOT 2
- atSetRingProperties and cavpts side effect HOT 1
- Closed orbit in momentum aperture HOT 2
- Transverse Damping coming from EnergyLoss element HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from at.