-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Removing high/low frequency noise #46
base: main
Are you sure you want to change the base?
Conversation
I have added the code which does the following: 1. Transform the data to the frequency domain using FFT. 2. Apply a bandpass filter by zeroing out components outside the specified frequency range. 3. Perform the inverse FFT to return to the time domain, giving a cleaned-up version of the data with reduced noise.
Removed the section for plotting the difference
@ubsuny/cp1-24 Anyone wants to review this? |
@Cosmos491 You have to resolve the merge conflicts before this can be merged as we discussed in class. |
This unit test module has the following functions: 1. setUp: Generates synthetic data with a known mix of low and high-frequency components. 2. test_remove_low_frequency: Tests removing frequencies below 0.02, verifying that low frequencies are removed by checking the FFT result. 3. test_remove_high_frequency: Tests removing frequencies above 0.02, ensuring that high frequencies are removed. 4. test_full_bandpass_filter: Tests both low and high frequency filtering by setting a bandpass filter between 0.01 and 0.05.
Added a data variable for the example
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we need to write these methods in the same preparation.py
module file. We shouldn't make separate module files for these. Same for unit test cases as well. Please do include them in test_preparation.py
module file.
@dhamalakamal I will work on them now. Thanks |
added the remove noise function in the same preparation.py module
added the unit tests function to remove noise
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. Have to be careful while merging. Might come some conflict there.
The code does the following steps:
This example retains frequencies between 0.001 Hz and 0.05 Hz, effectively filtering out lower and higher frequencies. I have to adjust low_freq and high_freq based on the signal characteristics: I need to experiment with different thresholds to find suitable values for the collected data.