Comments (3)
Hi,
there is no function implemented in ldparser, but I did that somewhere else.
Essentially, you don't need an extra list holding time, you only need the length of the data. If a channel has double the samplerate, it has double the data... So, in order to get channs[1].data with the samplerate of channs[0].data, you can do s.t. like this:
n0 = len(channs[0].data)
n = len(channs[1].data)
x = np.arange(0, n, n / n0)
data = np.interp(x, np.arange(0, n), channs[1].data)
len(channs[0].data) == len(data)
Not sure if it's the best approach though, but it works for me ;)
There are also more 'advanced' methods to resample data, like
from scipy import signal
data = signal.resample(channs[1].data, n0)
but I think, this method is overkill for our kind of data, and it takes quite long ....
from ldparser.
This answer is great. I was unsure about the underlying assumption that the data is sync'd and I could use the sample rate to fix it.
from ldparser.
Well, don't take my word for it ;) But that's how it appears to be in the data I saw so far. Also, you can check if the assumption holds by doing n/channs[1].freq == n0/channs[0].freq
. This shows that the data covers the same timespan and I guess it's save to assume that the acquisition of the data started in sync...
from ldparser.
Related Issues (10)
- Work on writing the ld format (From CSV) HOT 4
- MoTeC i2 failsto open written .ld files HOT 9
- Issue using the new version HOT 10
- Found a new conversion value HOT 1
- datatyp error HOT 3
- UnicodeDecodeError and Datatype 5 not recognised. HOT 2
- DiRT Rally 2.0 RDA HOT 2
- writing HOT 8
- Question - Feature request on the ldChan class HOT 4
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 ldparser.