How can I apply filer for three signal using matlab
2 views (last 30 days)
Show older comments
[tm,signal1,Fs,labels]=rdmat('emg_healthy44m');
[tm,signal2,Fs,labels]=rdmat('emg_myopathy57m');
[tm,signal3,Fs,labels]=rdmat('emg_neuropathy62m');
I haver read three signals .Now I would like to apply filetring on the tree signals at a time using for Loop
0 Comments
Answers (1)
Star Strider
on 4 Aug 2022
If they all have the same sampling frequency and are the same lengths and the same filtering requirements, concatenate them as column vectors and filter them at the same time using filtfilt or bandpass (for example) or its friends:
signals = [signal1(:) signal2(:) signal3(:)];
signals_filt = bandpass(signals, [f_low f_high], Fs);
simialrly:
signals_filt = filtfilt(sos,g,signals);
No loops are necessary.
If they are not the same lengths or have different filters or other characteristics, then it will be necessary to ‘brute force’ the filtering:
signal1_filt = bandpass(signal1, [f_low1 f_high1], Fs1);
signal2_filt = bandpass(signal2, [f_low2 f_high2], Fs2);
signal3_filt = bandpass(signal3, [f_low3 f_high3], Fs3);
In this instance, a loop is likely not the most efficient option.
.
0 Comments
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!