File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change 2020import audiobusio
2121import board
2222import neopixel
23- import ulab .numerical as numerical
24- import ulab .extras as extras
25- import ulab as np
23+ from ulab .scipy .signal import spectrogram
24+ from ulab import numpy as np
2625import adafruit_lsm6ds
2726from adafruit_led_animation .helper import PixelMap
2827from adafruit_led_animation .sequence import AnimationSequence
@@ -236,11 +235,11 @@ def rockstar_tilt(duration):
236235 elif MODE >= 1 : # If not OFF MODE...
237236 mic .record (samples_bit , len (samples_bit ))
238237 samples = np .array (samples_bit [3 :])
239- spectrum = extras . spectrogram (samples )
238+ spectrum = spectrogram (samples )
240239 spectrum = spectrum [:128 ]
241240 spectrum [0 ] = 0
242241 spectrum [1 ] = 0
243- peak_idx = numerical .argmax (spectrum )
242+ peak_idx = np .argmax (spectrum )
244243 peak_freq = peak_idx * 16000 / 256
245244# print((peak_idx, peak_freq, spectrum[peak_idx]))
246245 magnitude = spectrum [peak_idx ]
You can’t perform that action at this time.
0 commit comments