Hi Francois,
does the resample function in brainstorm can avoid Signal aliasing? How does it work?
I get so many example in the functions? What are the differences between these usage? By the way, where can I get tutorial (I just search the Brianstorm Website)?
Hope you everything goes well
I'm sorry, there is no advanced documentation for the resample function, beyond the documentation in the code itself. The method used by default is 'resample-cascade'.
% Time = linspace(Time(1), Time(end), size(x,2));
Time = Time(1) + (0:(size(TFout,2)-1)) ./ NewFreq;
end
%% ========================================================================================
% ====== RESAMPLING FUNCTIONS ============================================================
% ========================================================================================
%% ====== RESAMPLE-CASCADE =====
% USAGE: [x,Pfac,Qfac] = process_resample('ResampleCascade', x, NewRate, OldRate, Method)
% INPUT:
% - x : Signal to process [nChannels x nTime]
% - NewRate : New sampling frequency (Hz)
% - OldRate : Original sampling frequency (Hz)
% - Method : 'resample' or 'decimate'
% OUTPUT:
% - x : Resampled signal
% - Pfac : Array of successive upsampling factors
% - Qfac : List of successive downsampling factors
% NOTE: Requires Signal Processing Toolbox
You can use the function "test_resample.m" to evaluate the difference between these methods.
function [a, time_in, time_out, el] = test_resample(a_init, sfreq_out, sfreq_in)
% TEST_RESAMPLE: Test all the methods available in Brainstorm for resamlping.
%
% USAGE: test_resample(a_init, sfreq_out, sfreq_in)
% test_resample(a_init)
% test_resample()
% [a, time_in, time_out, el] = test_resample();
%
% INPUT:
% - a_init : Signal to resample
% Default: [cos(t);sin(t)], with t=-pi:.0001:pi
% - sfreq_out : Output sampling frequency
% Default: 4217
% - sfreq_in : Initial sampling frequency
% Default: 5000
%
% OUTPUT:
% - a : Cell-array oo the resampled signals for each method
% - time_in : Input time vector (scalar)
% - time_out : Resampled time vector for each method
This file has been truncated. show original
1 Like
Francois:
resample
Thanks, Francois. It helps a lot