UliEngineering/SignalProcessing/FFT.py
Function fft_cut_dc_artifacts
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
Open
def fft_cut_dc_artifacts(fft, return_idx=False):
"""
If an FFT contains DC artifacts, i.e. a large value in the first FFT samples,
this function can be used to remove this area from the FFT value set.
This function cuts every value up to (but not including the) first local minimum.
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function parallel_fft_reduce
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def parallel_fft_reduce(chunkgen, samplerate, fftsize, removeDC=False, window="blackman", reducer=sum_reducer, normalize=True, executor=None):
Function serial_fft_reduce
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def serial_fft_reduce(chunkgen, samplerate, fftsize, removeDC=False, window="blackman", reducer=sum_reducer, normalize=True, window_param=None):
Function __getitem__
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
Open
def __getitem__(self, arg):
"""
Select a frequency range:
fft[1.0:100.0] selects the 1.0 ... 100.0 Hz frequency range
fft[1.0:] selects everything from 1.0 Hz to the max frequency
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function simple_fft_reduce
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def simple_fft_reduce(fn, arr, samplerate, fftsize, shiftsize=None, nthreads=4, **kwargs):
Function __fft_reduce_worker
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def __fft_reduce_worker(chunkgen, i, window, fftsize, removeDC):