Write the summary about this PR.
SNR(signal to noise ratio) is the ratio of signal to noise power on STFT.
The source of how to calculate SNR is from the paper "High-Accuracy Unsupervised Fault Detection of Industrial Robots Using Current Signal Analysis" published in 2019 IEEE.
link : https://ieeexplore.ieee.org/abstract/document/8819374
Changes
Write changes in detail.
Add snr function on onebone/feature/init.py
Add snr function on onebone/feature
Add test_snr.py for testing snr function
Get the frequency, time, power of signal by using signal.spectrogram.
p = the max power intensity over the entire frequency range at time point t.
res = (the sum of power intensity over the entire frequency range at time point t) - p
snr = p/res
Changes from previous PR
previous PR : https://github.com/Onepredict/onebone/pull/51
The reason why I make new PR : I changed the branch name and the previous PR was automatically closed.
Changes)
Add the equation of snr using latex
make the test code with hard coding
How to Test?
Check that snr can't work on complex signal by using the function 'check_bad_args' in test_snr.py
Generate the 1D real signal by using the function 'generate_signal' in test_snr.py.
Check that output and expected_return are the same.
Checklist
[V] Do you pass all the tests?
[V] Do you write the changes on document such as README?
Summary
Write the summary about this PR. SNR(signal to noise ratio) is the ratio of signal to noise power on STFT. The source of how to calculate SNR is from the paper "High-Accuracy Unsupervised Fault Detection of Industrial Robots Using Current Signal Analysis" published in 2019 IEEE. link : https://ieeexplore.ieee.org/abstract/document/8819374
Changes
Write changes in detail. Add snr function on onebone/feature/init.py Add snr function on onebone/feature Add test_snr.py for testing snr function
Get the frequency, time, power of signal by using signal.spectrogram. p = the max power intensity over the entire frequency range at time point t. res = (the sum of power intensity over the entire frequency range at time point t) - p snr = p/res
How to Test?
Check that snr can't work on complex signal by using the function 'check_bad_args' in test_snr.py Generate the 1D real signal by using the function 'generate_signal' in test_snr.py. Check that output and expected_return are the same.
Checklist