Updated documentation for configuration settings
This commit is contained in:
parent
51eda2f0ba
commit
e3a810db09
@ -9,42 +9,53 @@ N_PIXELS = 60
|
|||||||
GAMMA_TABLE_PATH = os.path.join(os.path.dirname(__file__), 'gamma_table.npy')
|
GAMMA_TABLE_PATH = os.path.join(os.path.dirname(__file__), 'gamma_table.npy')
|
||||||
"""Location of the gamma correction table"""
|
"""Location of the gamma correction table"""
|
||||||
|
|
||||||
UDP_IP = '192.168.0.150'
|
UDP_IP = '192.168.137.150'
|
||||||
"""IP address of the ESP8266"""
|
"""IP address of the ESP8266"""
|
||||||
|
|
||||||
UDP_PORT = 7777
|
UDP_PORT = 7777
|
||||||
"""Port number used for socket communication between Python and ESP8266"""
|
"""Port number used for socket communication between Python and ESP8266"""
|
||||||
|
|
||||||
#MIC_RATE = 44100
|
|
||||||
MIC_RATE = 48000
|
MIC_RATE = 48000
|
||||||
"""Sampling frequency of the microphone in Hz"""
|
"""Sampling frequency of the microphone in Hz"""
|
||||||
|
|
||||||
FPS = 100
|
FPS = 60
|
||||||
"""Desired LED strip update rate in frames (updates) per second
|
"""Desired refresh rate of the visualization (frames per second)
|
||||||
|
|
||||||
This is the desired update rate of the LED strip. The actual refresh rate of
|
FPS indicates the desired refresh rate, or frames-per-second, of the audio
|
||||||
the LED strip may be lower if the time needed for signal processing exceeds
|
visualization. The actual refresh rate may be lower if the computer cannot keep
|
||||||
the per-frame recording time.
|
up with desired FPS value.
|
||||||
|
|
||||||
A high FPS results in low latency and smooth animations, but it also reduces
|
Higher framerates improve "responsiveness" and reduce the latency of the
|
||||||
the duration of the short-time Fourier transform. This can negatively affect
|
visualization but are more computationally expensive.
|
||||||
low frequency (bass) response.
|
|
||||||
|
Low framerates are less computationally expensive, but the visualization may
|
||||||
|
appear "sluggish" or out of sync with the audio being played if it is too low.
|
||||||
|
|
||||||
|
The FPS should not exceed the maximum refresh rate of the LED strip, which
|
||||||
|
depends on how long the LED strip is.
|
||||||
"""
|
"""
|
||||||
|
_max_led_FPS = int(((N_PIXELS * 30e-6) + 50e-6)**-1.0)
|
||||||
|
assert FPS <= _max_led_FPS, 'FPS must be <= {}'.format(_max_led_FPS)
|
||||||
|
|
||||||
MIN_FREQUENCY = 200
|
MIN_FREQUENCY = 200
|
||||||
"""Frequencies below this value will be removed during onset detection"""
|
"""Frequencies below this value will be removed during audio processing"""
|
||||||
|
|
||||||
MAX_FREQUENCY = 14000
|
MAX_FREQUENCY = 12000
|
||||||
"""Frequencies above this value will be removed during onset detection"""
|
"""Frequencies above this value will be removed during audio processing"""
|
||||||
|
|
||||||
N_SUBBANDS = 30 # 240 #48
|
N_FFT_BINS = 30
|
||||||
"""Number of frequency bins to use for beat detection
|
"""Number of frequency bins to use when transforming audio to frequency domain
|
||||||
|
|
||||||
More subbands improve beat detection sensitivity but it may become more
|
Fast Fourier transforms are used to transform time-domain audio data to the
|
||||||
challenging for the visualization to work for a wide range of music.
|
frequency domain. The frequencies present in the audio signal are assigned
|
||||||
|
to their respective frequency bins. This value indicates the number of
|
||||||
|
frequency bins to use.
|
||||||
|
|
||||||
Fewer subbands reduces signal processing time at the expense of beat detection
|
A small number of bins reduces the frequency resolution of the visualization
|
||||||
sensitivity.
|
but improves amplitude resolution. The opposite is true when using a large
|
||||||
|
number of bins.
|
||||||
|
|
||||||
|
There is no point using more bins than there are pixels on the LED strip.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
GAMMA_CORRECTION = True
|
GAMMA_CORRECTION = True
|
||||||
|
Loading…
Reference in New Issue
Block a user