522446 v2 basic functions
Info
This question is closed. Reopen it to edit or answer.
Show older comments
1.1 Functions:
- Diff()
- Trapz()
- Cumtrapz()
Cumtrapz(1/Fs, sig.^2)
Cumtrapz(Y, dim)
- where Y = time dimension = 1 / frequency
- Dim = amplitudes
Making time vector t = (0:length - 1) / Fs
1.3 Functions:
- Snr()
- (power) --> mean(x.^2)
- SNR = 10*log10(power signal / power noise)
Signal = (index: index)
Noise = (index:index)
Powersignal = (mean(sig.^2))
Powernoise = mean(noise.^2)
1.4 Functions
- Always use 4th order filter
- Check cutoff freq by plotting
- Rectify signal --> abs(sig)
- Filter rectified signal --> butter() ---> filtfilt()
[b,a] = butter(4,4/(Fs/2), '[filter type]')
Env1 - filtfilt(b,a,abs(sig1))
Env2 = filtfilt(b,a,abs(sig2))
1.5 Functions
- Downsample()
- Interp1()
Downsample factor = Fs_original / Fs_downsample
Downsample(sig, downsample factor)
Interp1(x,y,t,'[interp method]')
Where x = downsample time vector (1/Fs)
Where y = signal downsampled
Where t = time vector with time values that don't have y value
2.2 Functions
- Sig = sig-mean(sig)
- Lowpass filt
OR
- DC OFFSET = 0 Hz signal
- Make cutoff (0.1 --> x)
- Bandpass filt
Mean(diff(t)) = Fs
Fc = [0.1 100]/(Fs/2)
DC OFFSET REMOVAL
- Sig = sig-mean(sig)
Noise removal (lowpass)
[b,a] = butter(4, 10/(Fs/2), 'low')
Sigfilt = filtfilt(b,a,sig)
2.3 Functions
- iirnotch()
Wo = 60/(Fs/2)
Bw = 2/(Fs/2)
60 Hz for North America
Wo = noise freq
Bw = bandwidth
2.4 Functions
- EMG, ECG, EEG
- EMG: freqs up to 400-500 Hz
- ECG/EEG: freqs up to 50 Hz
- ECG: Large peak at 1-2 Hz (heartbeat)
- EEG: no large peak at 1-2 Hz
1 Comment
John D'Errico
33 minutes ago
What is your question (concerning MATLAB) in this?
Answers (0)
This question is closed.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!