Comments (6)
that would be great to have this but my gut feeling is that piece of code
should land into scipy.signal
have you looked at:
http://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.resample.html
I would send an email on the scipy-devel mailing list if somebody has done
this already and if there is an interest in scipy.signal.
option 2 is to have a resample method that uses scipy.signal.resample or
upfirdn http://code.google.com/p/upfirdn/ if availble.
makes sense?
from mne-python.
Yeah, I started trying to use upfirdn, and it was not as straightforward as I had hoped. Maybe for now we can try the scipy.signal.resample, and look at some results. We can always add more methods later (e.g., method='upfirdn' or whatever). How do you think on this:
-
Make generic function in mne-python that takes in a numpy array, in sample rate, and out sample rate, and (for now) basically wraps to scipy's resample, returning the resampled array. This way we could eventually change what we use for resampling, or extend it if we want.
-
Make methods in epochs (and wherever else) that call this generic function.
If this sounds reasonable, what would you like the function to be called for (1) the general function and (2) in epochs specifically? And what mne-python file should I put the general function in?
from mne-python.
Yeah, I started trying to use upfirdn, and it was not as straightforward
as I had hoped. Maybe for now we can try the scipy.signal.resample, and look
at some results. We can always add more methods later (e.g.,
method='upfirdn' or whatever).
makes sense
How do you think on this:
- Make generic function in mne-python that takes in a numpy array, in
sample rate, and out sample rate, and (for now) basically wraps to scipy's
resample, returning the resampled array. This way we could eventually change
what we use for resampling, or extend it if we want.
yes
- Make methods in epochs (and wherever else) that call this generic
function.
+1
If this sounds reasonable, what would you like the function to be called
for (1) the general function and (2) in epochs specifically? And what
mne-python file should I put the general function in?
I would say all called resample.
mne.time_frequency.resample()
Epochs.resample()
Evoked.resample()
I am relunctant to add a new signal module just for one function.
from mne-python.
Should I put the resample() function (the one that gets called by Epochs and Evoked, etc.) in filter.py? Seems like a natural fit.
from mne-python.
Yes
Le 26 sept. 2012 à 19:17, Eric89GXL [email protected] a écrit :
Should I put the resample() function in filter.py? Seems like a natural fit.
—
Reply to this email directly or view it on GitHub.
from mne-python.
So I've implemented a resample() function in filter.py. Comparing the results to MATLAB, it looks like I can actually get less (!) ringing in Python than I get using MATLAB's resample() (based on upfirdn) by using the 'flat' window, and zero-padding the data appropriately. I wrote it to operate on N-dimensional arrays along a given axis but haven't tested that yet, but I'm going to submit a pull request so people can try it out to see if they think it's reasonable.
from mne-python.
Related Issues (20)
- Building the MNE doc fails with Python 3.12 and 3.11 (?) HOT 5
- _extract_sampling_rate function for io.read_raw_snirf incorrectly estimates sample rate due to floating point error. HOT 3
- BUG: EpochsTFR bug popping up in MNE-BIDS-Pipeline HOT 1
- Read_raw_eyelink failure: missing headpos data in file HOT 4
- GDF reader bug HOT 6
- raw.compute_psd("multitaper", ...) on a raw with "bad_xxx" annotations yields all np.nan HOT 1
- BUG: EDF export failing on latest edfio HOT 3
- mne.time_frequency.read_tfrs() did not work correctly when MNE.Raw.compute_tfr(method='multitaper', output='phase') HOT 1
- Complete uninstall documentation missing HOT 3
- set_annotations changes key:value mapping in event_id dict HOT 5
- Be more explicit about what is returned by read_epochs_eeglab and read_epochs_kit HOT 3
- Unicode support in the method add.text() of mne.viz.brain HOT 1
- Can't download the fsaverage data by mne.datasets.fetch_fsaverage(verbose=0) HOT 3
- Bad channels do not show up at all in `raw.plot()` HOT 4
- Mouse Offset in Brain Plot HOT 14
- Incorrect rendering of embedded HTML title (?) HOT 4
- Layout issues in documentation (horizontal navbar) HOT 26
- Add SOUND and SSP-SIR algorithms HOT 3
- Cannot build docs HOT 8
- Customize website color palette HOT 5
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 mne-python.