Skip to content

Logbook ‐ Benson

Benson Cho edited this page Jul 24, 2024 · 27 revisions

🤡

Note

3/06/2024

  • Research into NMF (Non-negative matrix factorization) as a way to decompose the spectrogram. This is relevant to our intention to the highs, lows and mediums of the piece. NMF works by reducing the dimensionality of the input.

  • Can also look into the process of vocal separation by using frequency masks. (Done by using librosa.util.softmask), choice is between using a binary mask vs soft mask..

  • Sound separation into emotions was explored by separating aspects of the spectrogram. image

  • MFCC is important descriptor for Timbre

Mel-frequency cepstral coefficients (MFCCs) represent timbral information of a signal and are computed by converting Fourier coefficients to Mel-scale, logarithmizing the obtained vectors, and decorrelating them by DCT to remove redundant information. (https://www.sciencedirect.com/topics/computer-science/cepstral-coefficient)

Note

5/06/2024 After meeting

  • Try to bump up sampling rate to 44kHz, 16kHz may cause us to lose important components
  • As a start should just straight up split the frequencies into high low med with band pass
  • Figure out what feature to extract from each window in those different sections
  • Map the value of the feature to a value
  • https://en.wikipedia.org/wiki/Reassignment_method Apparently important

Note

9/06/2024

  • Spectral centroid can be good to identify "brightness"
  • Might have to find other descriptors like attack and decay
  • Attack is describe as spectral onset
  • We can normalise spectral centroid to a "temperature"
  • Attack is turned into a binary mask to indicate "turning points" when actuators should be modulated etc
  • When mapping temperature, we need to decide if an attack should result in an increase or decrease because of the different interpretations of what music is meant to make someone feel
  • Will have to look at the vibration characteristics of the ERM motors i.e (https://www.precisionmicrodrives.com/ab-004)
  • Need DAC? or PWM image

Note

10/06/2024

Mapping normalised centroid values to pwm seems to be working:

const int pwmPin = 9; 

const int pwmValues[] = {
// Omitted
};

void setup() {
  pinMode(pwmPin, OUTPUT);
}

void loop() {

  for (int i = 0; i <= sizeof(pwmValues)/sizeof(int); i++) {
    analogWrite(pwmPin, i); // Set the PWM value
    delay(1); // Wait for 1 milliseconds
  }
}

Start work on H-bridge to control peltier

image

PNP transistor choice: bc640

image

NPN transistor choice: bc639

image

Peltier temperature characteristics for CP40236

image

Note

14/06/2024

Using 13N10 MOSFET image

Note

17/06/2024

Add micropython for use with pico pi, used VS Code integration

Note

18/06/2024

LN289 can be controlled with anything $&gt;2.3V$ which is good

image

We should use this to control polarity of the hot/cold side

Might have to remove bass components in order to keep the melody, as we want to describe the "story" described by the melody

Note

19/06/2024

Working on getting the LN298s working

image

Truth Table

IN1 IN2 State
0 0 Does nothing
0 1 on
1 0 on
1 1 Does nothing

confirmed using the following code:

while True:
    in1_pin.on()
    in2_pin.off()
    sleep(3)
    in1_pin.off()
    in2_pin.on()
    sleep(3)
    in1_pin.off()
    in2_pin.off()
    sleep(3)
    in1_pin.on()
    in2_pin.on()
    sleep(3)

example doing a temperature gradient

while True:
    # Hot increase
    forward()
    for cock in range(0, 65565, 2000):
        enable_pin.duty_u16(cock)
        sleep(0.1)

    # Hold
    sleep(1)

    # Hot decrease
    for cock in range(65565, 0, -2000):
        enable_pin.duty_u16(cock)
        sleep(0.1)
    reverse()


    # Cold decrease
    for cock in range(0, 65565, 2000):
        enable_pin.duty_u16(cock)
        sleep(0.1)

    # Hold
    sleep(1)

    # Cold decrease
    for cock in range(65565, 0, -2000):
        enable_pin.duty_u16(cock)
        sleep(0.1)

Experimental measurements

1 Peltier -> $4V$, $500mA$ works good for warm only ( cold response needs more time to ramp up ), $600mA$ may work better for cold - however this makes it way too hot

PWM modulation needs to always go back down to zero to put it back to an "ambient" temperature.

TES1-4903 is the peltier we are using rated at $6V$.

PWM frequency for the the peliters using the Pico Pi W can be set to $500Hz$. Gradually increasing/decreasing the PWM doesn't seem to have much of a noticable effect.

to go from ambient to any extreme at a polarity it seems to be effective to have a ramping PWM (that goes from high to low)

The minimum step to ramp up the temperature to allow the changes to somewhat be felt is $0.01s$ or $10ms$). Unclear on how to regulate a "base temperature", may have to use the thermistors.

From the limitations discussed here some good future steps may involve:

  • Adding customisability (i.e to different body shapes or temperature preferences)
  • Finding a way to include multiple sleeves

Note

20/06/2024 Start working on getting a web server set up on pico, to allow for requests to be sent across devices

Also created utility class to easier control the peltiers

Note

04/07/2024

Nice to haves:

  • PCB enclosure
  • Redesigned PCB
  • Battery
  • AI model as a web API

Note

SVM Notes

  • First non-linear problem
  • Optimisation algorithm, reduces local minimums
  • Need to choose kernel
  • For AV mapping it predicts where it should lie based on the features
  • $R^2$ is how well the line fits

Regression: Predicting variation in one value based on another.

Note

H bridge wiring notes

Need to connect IN1 and IN2 to the same pin for both peltiers on the H-Bridge to allow for consistency.

Note

LSTM

Input decides what values to leat through the weighting of inputs is based on tanh

Decent model found - Librosa spectra features with a single-layer attention model (AT_64) good for predicting arousal (EXPLAININGPERCEIVEDEMOTIONPREDICTIONSINMUSIC: ANATTENTIVEAPPROACH)

Note

Supplying enough power to peltier circuit

Need to use parallel sources and have both master and slave connected. $5V$ is the best voltage to use

Note

08/07/2024

We choose to put the device behind the user so they don't have to have focus on the electronics. A "safe" distance is considered $1m$.

Wire colour codes:

Pin Colour Qty per PCB pin
IN1 Green 2
IN2 Yellow 2
EN1 White 1
EN2 Orange 1
VCC Red 2
GND Black 1

Might not have to use fuses if we current limit the sources

Note

09/07/2024

Can connect 5 peltiers at the same time, now we should have some sort of visualisation to give a theoretical description of the actuation.

Concept for simple graph image

"Zone" visualisations at each time point

image

Note

Sections for presentation

  • Technical sections split into three

    • AI
      • Explain model selection and features, dataset
      • Why not using valence - hard to quantify using sound features
    • Hardware
      • Explain setup
      • Fabrication process
      • Peltier usage
      • Show sleeve
    • Software
      • Show visualisations
      • Communication with hardware
      • User control
  • Future steps, declare prototype is ready

  • Brief overview of experiment

Note

17/07/2024

Mid year assets:

image

Preprocessing stage

ActuatingStep

VisualisationInterface

Note

25/07/2024

  • We should check the citations on papers, year published
  • Might have to discretize the arousal values (no one is going to feel the minute temperature differences)
  • Check annotations of pieces in the database.
  • Plot a histogram showing the range of arousal values
  • The outsider
Clone this wiki locally