SPECTRAL FEATURES Filter Cutoff Frequency not saved on edgeImpulse Studio

Hi,
On the site when I open the Spectral Features tab, I see the following error Error: Digital filter critical frequencies must be 0 < Wn < 1. So I try to make the critical frequency half of the sampling frequency to solve this. I press Save Parameters button to save the settings.

Then I open the the Generate features sub tab and press the Generate Features button, I am greeted with the following error.

Creating job... OK (ID: 183979)

Creating windows from 6 files...
[1/6] Creating windows from files...
[6/6] Creating windows from files...
Created 18 windows: M: 9, O: 9

Scheduling job in cluster...
Job started
Creating features
Traceback (most recent call last):
  File "/home/create_features.py", line 61, in <module>
    f = generate_features(False, example[1:], axes, freq, scale_axes=1, filter_cutoff=15, filter_order=6, fft_length=128, spectral_peaks_count=3, spectral_peaks_threshold=0.1, spectral_power_edges="0.1, 0.5, 1.0, 2.0, 5.0", filter_type="low")
  File "/home/dsp.py", line 146, in generate_features
    fx = filter(filter_type, sampling_freq, filter_cutoff * 2, filter_order, fx)
  File "/home/dsp.py", line 12, in filter
    [b, a] = signal.butter(filt_order, Wn=Wn, btype=type)
  File "/usr/local/lib/python3.7/site-packages/scipy/signal/filter_design.py", line 2858, in butter
    output=output, ftype='butter', fs=fs)
  File "/usr/local/lib/python3.7/site-packages/scipy/signal/filter_design.py", line 2341, in iirfilter
    raise ValueError("Digital filter critical frequencies "
ValueError: Digital filter critical frequencies must be 0 < Wn < 1

Application exited with code 1 (Error)

Job failed (see above)

Kindly advise.

@paulphilip What settings have you chosen for your cutoff frequency and filter order?

Following are the parameters that was preset.

Parameters

Scaling

Scale axes

1

Filter

Type

low

Cut-off frequency

15

Order

6

Spectral power

FFT length

128

No. of peaks

3

Peaks threshold

0.1

Power edges

0.1, 0.5, 1.0, 2.0, 5.0

As mentioned above, I changed the Cutoff frequency to 6Hz as sampling frequency is 14Hz. Still it is not getting saved.

The Workaround I had to do was change the sample being analysed to another dataset and then press save. Now I am able to generate spectral features. Please check this UX issue.

Creating job... OK (ID: 183995)

Creating windows from 6 files...
[1/6] Creating windows from files...
[6/6] Creating windows from files...
Created 18 windows: M: 9, O: 9

Scheduling job in cluster...

Job completed

Thanks for the support.

I’m not completely sure what you mean here. You can indeed not set the cutoff frequency to 15Hz if your data was sampled at 14Hz, and we could improve on the error, but I don’t see what your workaround is.

@janjongboom

If there is an error in the Cutoff frequency, even if I change it, it is not getting changed(For the current sample selected). So I selected another sample so that the updated Cutoff Frequency gets applied and then I can save it using the Save Parameters Button.