starblue has quit [Ping timeout: 260 seconds]
starblue has joined #rust-embedded
<re_irc> <@9names:matrix.org> If the goal is human perception you would ideally have pink noise instead of white, and use the same Freq/power transfer function for your tone generator
fabic has joined #rust-embedded
<re_irc> <@luojia65:matrix.org> I'm trying to write a USB enumerator in the API style like std::path and std::fs
<re_irc> <@luojia65:matrix.org> Still in experiment: https://github.com/luojia65/usb-z
PyroPeter has quit [Ping timeout: 258 seconds]
PyroPeter has joined #rust-embedded
hifi has quit [Remote host closed the connection]
hifi has joined #rust-embedded
hifi has quit [Remote host closed the connection]
hifi has joined #rust-embedded
fabic has quit [Ping timeout: 260 seconds]
crabbedhaloablut has quit [Ping timeout: 276 seconds]
GenTooMan has quit [Ping timeout: 245 seconds]
GenTooMan has joined #rust-embedded
crabbedhaloablut has joined #rust-embedded
hifi has quit [Remote host closed the connection]
hifi has joined #rust-embedded
crabbedhaloablut has quit [Remote host closed the connection]
crabbedhaloablut has joined #rust-embedded
tokomak has joined #rust-embedded
hifi has quit [Remote host closed the connection]
hifi has joined #rust-embedded
<re_irc> <@henrik_alser:matrix.org> firefrommoonlight: The frequency response of the human hearing is an incredibly complex pandora's box.
<re_irc> <@henrik_alser:matrix.org> To a first degree the "perceived loudness vs frequency" is a function of absolute sound pressure level,
<re_irc> <@henrik_alser:matrix.org> i'd recommend you to beging with studying the works of Fletcher-Munson and the isophon "equal-loudness contours". So in order to have anywhere near useful results you'd have to compensate the playback gain vs frequency depending on at what sound pressure level it is being reproduced.
<re_irc> <@henrik_alser:matrix.org> Then there's the topic of the psychoacoustic effect of masking, that is the loudness of one frequency is dependent on the presence of other frequencies that may mask or enhance it. We also have a strong dependency on harmonic series so we can imagine we hear frequencies that are not even there.
<re_irc> <@henrik_alser:matrix.org> It's extremely difficult to compare the relative loudness of discrete frequencies in a meaningful way, due to how our hearing is working. The best shot we in the audio world have at assessing the percieved flatness at a particular sound pressure level is equalizing pink noise (-3dB/octave slope) and it takes quite some skills of the listener to be able to tell what is "flat" for them.
<re_irc> <@henrik_alser:matrix.org> (Just look at what people do when they’re trusted with adjusting their home/car stereo equalizers 😭 lol)
fabic has joined #rust-embedded
<re_irc> <@firefrommoonlight:matrix.org> 9names: Thank you! Diving in
<re_irc> <@firefrommoonlight:matrix.org> henrik_alser: Thank you for the details - looks like I have some reading (And later on experimenting!) to do
<re_irc> <@firefrommoonlight:matrix.org> It also hits on several points that will come up later in the course of this project that I'd worried about
<re_irc> <@firefrommoonlight:matrix.org> I'm copying+pasting your comment into the code as a comment...
<re_irc> <@henrik_alser:matrix.org> Just ask if you need further pointers down the line!
<re_irc> <@firefrommoonlight:matrix.org> There's a hearing test I have to do once a year, wherein a series of tones is played, and you press a button when you hear a tone. It's a bit frustrating, since you end up imagining tones that aren't there, since they're so faint. And it's very sensitive to background level, so you're in a closed box. I was imagining inteaad, perhaps a flat level of noise, then a notice a tone's about to play, then...
<re_irc> ... a tone, then it asks you to press a button for "loud and clear" "can barely hear", "can't hear", and "play again". It does this at various freqs and volumes
<re_irc> <@firefrommoonlight:matrix.org> Then tunes the headphone /hearing-aid outputs, and or lets you view the info. (Or lets you input an audiogram from your doc etc)
<re_irc> <@firefrommoonlight:matrix.org> I'm WAY over my head on this one, so that's going to happen!
<re_irc> <@firefrommoonlight:matrix.org> I'm also trying to do a whole bunch of other weird stuff with this project I'll get into later
<re_irc> <@henrik_alser:matrix.org> Interesting, it all comes down to what you're trying to measure - those audionom tests are generally constructed to mesure absolute hearing threshold, which may or may not be an indicator of frequency the response at other loudness levels
fabic has quit [Ping timeout: 258 seconds]
<re_irc> <@firefrommoonlight:matrix.org> It's neat how this is a mix of physics and biology
fabic has joined #rust-embedded
fabic has quit [Ping timeout: 258 seconds]
GenTooMan has quit [Ping timeout: 245 seconds]
GenTooMan has joined #rust-embedded
tokomak has quit [Read error: Connection reset by peer]
fabic has joined #rust-embedded
fabic has quit [Ping timeout: 260 seconds]
<re_irc> <@jamesmunns:beeper.com> 404 :|
<cr1901> beeper.com? Also hi, jamesmunns, long time no see
<cr1901> at least on here
<re_irc> <@jamesmunns:beeper.com> heyyo
<re_irc> <@dirbaio:matrix.org> they just pushed it, probably some cache lagging behind :P
<re_irc> <@jamesmunns:beeper.com> yeah, it's also ne, I've started using beeper, can generally recommend. It's "every message platform bridged to matrix"
<cr1901> it's also ne?
<re_irc> <@jamesmunns:beeper.com> "me"
<re_irc> <@jamesmunns:beeper.com> Message edits don't show up on the IRC bridge, I guess :D
<re_irc> <@jamesmunns:beeper.com> (I'm usually much more active on #anachro:matrix.org , since my absurd off-topic rants seem much better placed there :D )
<cr1901> Well, I thought maybe you lost interest in Rust embedded outside of work :P
<cr1901> something something "hobby becomes job" something
<re_irc> <@jamesmunns:beeper.com> heh
<re_irc> <@jamesmunns:beeper.com> I don't do a lot of programming in my day job, unless something has gone seriously wrong :p
<re_irc> <@jamesmunns:beeper.com> So I'm still living that "rust embedded in nights and weekend" life, personally.
fabic has joined #rust-embedded
<re_irc> <@firefrommoonlight:matrix.org> I got the stm32 RNG code set up. Could probably generate pink noise by generating white noise with the summation algio, with the random nums generated by stm32. (No rand crate required), then apply a FIR filter from CMSIS-DSP to roll off the amplitude at higher freqs. Maybe
<re_irc> <@henrik_alser:matrix.org> firefrommoonlight:matrix.org: FIR might be overly expensive (low frequency resolution will require quite a few taps), you could use a couple of staggered one pole IIRs instead
<re_irc> <@henrik_alser:matrix.org> Here are some different cheap options for pink noise generation https://www.firstpr.com.au/dsp/pink-noise/
<re_irc> <@firefrommoonlight:matrix.org> Oh nice! I haven't yet learned about filters other than calling some Scipy and CMSIS functions; don't have a feel yet when to use each
<re_irc> <@firefrommoonlight:matrix.org> From the way this DSP book is going, it seems like FFT and convolution will come together to make it happen
<re_irc> <@firefrommoonlight:matrix.org> Since the coefficients for filters seem similar to convolution coeffs
<re_irc> <@firefrommoonlight:matrix.org> Going to try to inpl those algos
<re_irc> <@henrik_alser:matrix.org> Yeah FIR is convolution
fabic has quit [Ping timeout: 260 seconds]
<re_irc> <@firefrommoonlight:matrix.org> Does anyone know how to turn this into a concise macro, ie without the boilerplate for each variable you make?
<re_irc> <@firefrommoonlight:matrix.org> ```rust
<re_irc> <@firefrommoonlight:matrix.org> static SURFACE: AtomicU8 = AtomicU8::new(0);
<re_irc> <@firefrommoonlight:matrix.org> #[derive(Clone, Copy)]
<re_irc> <@firefrommoonlight:matrix.org> I use enums all the time for operating modes etc, but want to manipulate them atomically instead of in a `Mutex`/CS
<re_irc> <@firefrommoonlight:matrix.org> *actually, I'm not even sure what the API would be using a non-proc macro
<re_irc> <@firefrommoonlight:matrix.org> maybe this https://docs.rs/atomic_enum/0.1.1/atomic_enum/
<re_irc> <@firefrommoonlight:matrix.org> Although would have to fork etc since I don't think it's marked no_std
<re_irc> <@henrik_alser:matrix.org> Anyone checked out the RTL8720 yet?
<re_irc> <@jamesmunns:beeper.com> That isn't the chip they use in the wio terminal, is it?
<re_irc> <@jamesmunns:beeper.com> Yeah it is! henrik_alser there's a book (maybe only in Japanese?) That is based on the wio terminal and rust. I bet there's a bunch of working code around that out there
<re_irc> <@jamesmunns:beeper.com> Looks like maybe some of it lives in the atsamd Hal? (That's the main MCU on the wio terminal)
<re_irc> <@henrik_alser:matrix.org> James Munns: Ahh thanks!
<re_irc> <@jamesmunns:beeper.com> Specifically the RTL8720DN, no idea if that makes a difference tho
<re_irc> <@dirbaio:matrix.org> not running rust *in* the rtl though right? :P
<re_irc> <@henrik_alser:matrix.org> dirbaio:matrix.org: That would be too much fun i guess! What's a Real-M300 processor?
<re_irc> <@henrik_alser:matrix.org> I was looking at a SOM like AI-thinker BW16
<re_irc> <@dirbaio:matrix.org> > It consists of a high-performance MCU (Armv8-M, Cortex-M33 instruction set compatible) called Real-M300
<re_irc> <@henrik_alser:matrix.org> Looks like it has a M4F onboard
<re_irc> <@dirbaio:matrix.org> so ARMv8-m
<re_irc> <@dirbaio:matrix.org> but "cortex M33 instruction set compatible"
<re_irc> <@dirbaio:matrix.org> so it's a M33 or not? 🤣
<re_irc> <@henrik_alser:matrix.org> Close enough for rock n roll?
<re_irc> <@dirbaio:matrix.org> they licensed the ISA but not the M33 verilog and rolled their own instead?
<re_irc> <@dirbaio:matrix.org> does ARM even let you do that?
<re_irc> <@dirbaio:matrix.org> (that post is for another similar chip, this one is just the real m300 it seems)
<re_irc> <@dirbaio:matrix.org> so uh
<re_irc> <@dirbaio:matrix.org> if there are bugs in their homebrewed arm core, it could be *real fun* lol
emerent has quit [Ping timeout: 264 seconds]
emerent_ has joined #rust-embedded
emerent_ is now known as emerent
<re_irc> <@henrik_alser:matrix.org> Maybe better to focus on the ESP32-C3
<re_irc> <@dirbaio:matrix.org> yeah
<re_irc> <@dirbaio:matrix.org> sucky blob from manufacturer A vs sucky blob from manufacturer B
<re_irc> <@yatekii:matrix.org> Uff, folks, can any1 help me think through potential groundloops? :/
<re_irc> <@yatekii:matrix.org> I am totally unqualified for this and I am afraid :D
<re_irc> <@yatekii:matrix.org> I have a standing desk with an RS485 interface I wanna control via FTDI. Now I am afraid that I burn my appartment to the ground if I get a loop somewhere :/
<re_irc> <@yatekii:matrix.org> Am I illegimately afraid or do I have to be careful?
<re_irc> <@yatekii:matrix.org> (I burnt FTDIs in the past already)
<re_irc> <@dirbaio:matrix.org> put a bluetooth mcu in it instead :D
<re_irc> <@yatekii:matrix.org> (I thought about using the C3 via WiFi to alleviate potential issues but then I still need the programmer)
<re_irc> <@yatekii:matrix.org> yeah wont work I guess :D
<re_irc> <@henrik_alser:matrix.org> Noah: What is it connected to?
<re_irc> <@yatekii:matrix.org> USB Port of my PC <-> FTDI <-> UART <-> interface of the desk controller (no idea what's inside)
<re_irc> <@henrik_alser:matrix.org> If your gnd offsets are within the common mode offset limits of your transceivers you can just get rid of the ground wire (preferred)
<re_irc> <@yatekii:matrix.org> Is there any downside to not have the GND wire as in potential fire
<re_irc> <@yatekii:matrix.org> I feel so eternally stupid not understanding any of this as I have a degree in EE
<re_irc> <@henrik_alser:matrix.org> if you need them to float to some common potential you can limit the current with resistors
<re_irc> <@yatekii:matrix.org> which proves that universities are a joke :D
<re_irc> <@yatekii:matrix.org> (the grading system; there is tons of qualified folks ofc)
jackneill has joined #rust-embedded
<re_irc> <@henrik_alser:matrix.org> The harm of having it connected is that you might be creating a giant loop antenna that will pick up a lot of noise
<re_irc> <@yatekii:matrix.org> I mean there is folks doing stuff like I try to already: e.g. https://github.com/sarahkw/deskctrl and it does not feel like they care about ground anyways.
<re_irc> <@henrik_alser:matrix.org> If they're connected to the same power network you'd better just get rid of the wire and let the differential interface do what it's designed to do :)
<re_irc> <@yatekii:matrix.org> henrik_alser:matrix.org: Heh, will be funny when authorities are nocking on my door because I am spamming the spectrum :P
<re_irc> <@yatekii:matrix.org> Which differential system do you mean? :/
<re_irc> <@henrik_alser:matrix.org> the rs485
<re_irc> <@yatekii:matrix.org> oh, tbh I am not sure if it's proper RS485
<re_irc> <@yatekii:matrix.org> sorry I wrongly used it instead of UART
<re_irc> <@henrik_alser:matrix.org> It's designed to be "groundless"
<re_irc> <@henrik_alser:matrix.org> Oh so it's not rs485?
<re_irc> <@yatekii:matrix.org> https://github.com/phord/Jarvis well it's just some kind of UART
<re_irc> <@yatekii:matrix.org> I guess I cannot answer the specifics :/
<re_irc> <@yatekii:matrix.org> I am about to find out tho :D
<re_irc> <@henrik_alser:matrix.org> Ahh looks like normal uart then!
<re_irc> <@yatekii:matrix.org> If only I bought my new overly expensive macbook already ground would not be an issue damn
<re_irc> <@henrik_alser:matrix.org> Then you def need the ground wire :)
<re_irc> <@yatekii:matrix.org> Sadge
<re_irc> <@yatekii:matrix.org> so I wonder if I should just try and live with the consequences
<re_irc> <@yatekii:matrix.org> because many others seemt o have no issues but then again I feel like they did this all with a laptop (e.g. the youtube demo on some repo)
<re_irc> <@henrik_alser:matrix.org> No worries!
<re_irc> <@henrik_alser:matrix.org> Is it even connected to safety earth?
<re_irc> <@yatekii:matrix.org> The desk? I am not sure lol
<re_irc> <@yatekii:matrix.org> I could open the controller box
<re_irc> <@henrik_alser:matrix.org> is it a 3 prong cord?
<re_irc> <@yatekii:matrix.org> Ah yes, it is, but I wouldn't trust that :D
<re_irc> <@newam:matrix.org> I have a linak controller and it isn't grounded
<re_irc> <@henrik_alser:matrix.org> Either way, unless your laptop charger and the desk are connected to way different outlets with high earth offset there will be no current flowing in that ground wire
<re_irc> <@yatekii:matrix.org> wait no I lied
<re_irc> <@yatekii:matrix.org> no earth
<re_irc> <@henrik_alser:matrix.org> So just put them in the same power strip and you'll be safe
<re_irc> <@henrik_alser:matrix.org> Cool, go ahead!
<re_irc> <@yatekii:matrix.org> This will be an expensive experiment :D
<re_irc> <@yatekii:matrix.org> I'll report when I finished soldering and everything is burning :FD
<re_irc> <@yatekii:matrix.org> brb 5mins or so :D