https://github.com/krproject-tech/fft_filter
MATLAB code for Low Pass Filter (LPF) and High Pass Filter (HPF) based on Fast Fourier Transform (FFT).
https://github.com/krproject-tech/fft_filter
fft hpf lpf matlab
Last synced: 2 months ago
JSON representation
MATLAB code for Low Pass Filter (LPF) and High Pass Filter (HPF) based on Fast Fourier Transform (FFT).
- Host: GitHub
- URL: https://github.com/krproject-tech/fft_filter
- Owner: KRproject-tech
- License: mit
- Created: 2023-02-22T09:49:05.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-09-15T14:01:31.000Z (9 months ago)
- Last Synced: 2025-02-01T05:41:55.405Z (4 months ago)
- Topics: fft, hpf, lpf, matlab
- Language: MATLAB
- Homepage:
- Size: 24.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README

#
FFT_filter

![]()
**Communication**
**Language**
![]()
__MATLAB code for Low Pass Filter (LPF) and High Pass Filter (HPF) based on Fast Fourier Transform (FFT) [^1].__
# Usage
`filtered_data = FFT_filter_func( raw_data, [f_min f_max], plot_flag);`
where
`raw_data = [ time_vec data_vec]`: time data `time_vec` [s] and time series of raw data `data_vec` [a.u.].
`[f_min f_max]`: bandpass [Hz].
`plot_flag`: When the argument is present, the FFT spectrum is plotted.
## Source codes
* FFT_filter_func.m: FFT fliter function.
* demo.m: demonstration for FFT_filter_func.m.
## Images
__Input data example__:
$f(t) = 4\cos( 2\pi t) + 2\cos( 2\pi 10t) + \sin( 2\pi 100t)$
* __Power spectrum of input data__

* __0-20Hz LPF__: `FFT_filter_func( data, [0 20], 1);`
* __0-5Hz LPF__: `FFT_filter_func( data, [0 5], 1);`
* __5- Hz HPF__: `FFT_filter_func( data, [5 Inf], 1);`
### References
[^1]: .