From 533b2b98c295d2a40642f38889b89b962e5f98de Mon Sep 17 00:00:00 2001 From: threexfaster <132973928+threexfaster@users.noreply.github.com> Date: Sun, 19 Oct 2025 17:42:59 -0500 Subject: [PATCH] Update nano-ble-sense.md changed from ulab.scipy to ulab.utils to fix spectrogram --- .../04.board-examples/nano-ble-sense/nano-ble-sense.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/content/micropython/04.board-examples/nano-ble-sense/nano-ble-sense.md b/content/micropython/04.board-examples/nano-ble-sense/nano-ble-sense.md index 89a97ed334..151474b4cc 100644 --- a/content/micropython/04.board-examples/nano-ble-sense/nano-ble-sense.md +++ b/content/micropython/04.board-examples/nano-ble-sense/nano-ble-sense.md @@ -221,14 +221,14 @@ Below example can be used with OpenMV's frame buffer window (top right corner). ```python import image, audio, time from ulab import numpy as np -from ulab import scipy as sp +from ulab import utils CHANNELS = 1 SIZE = 256//(2*CHANNELS) raw_buf = None fb = image.Image(SIZE+50, SIZE, image.RGB565, copy_to_fb=True) -audio.init(channels=CHANNELS, frequency=16000, gain_db=80, highpass=0.9883) +audio.init(channels=CHANNELS, frequency=16000, gain_db=80) def audio_callback(buf): # NOTE: do Not call any function that allocates memory. @@ -259,10 +259,10 @@ while (True): raw_buf = None if CHANNELS == 1: - fft_buf = sp.signal.spectrogram(pcm_buf) + fft_buf = utils.spectrogram(pcm_buf) l_lvl = int((np.mean(abs(pcm_buf[1::2])) / 32768)*100) else: - fft_buf = sp.signal.spectrogram(pcm_buf[0::2]) + fft_buf = utils.spectrogram(pcm_buf[0::2]) l_lvl = int((np.mean(abs(pcm_buf[1::2])) / 32768)*100) r_lvl = int((np.mean(abs(pcm_buf[0::2])) / 32768)*100) @@ -330,4 +330,4 @@ from machine import Pin, SPI spi = SPI(1, baudrate=1000000, polarity=0, phase=0, sck=Pin(18), mosi=Pin(23), miso=Pin(19)) print("SPI initialized") -``` \ No newline at end of file +```