starblue has quit [Ping timeout: 260 seconds]
starblue has joined #rust-embedded
<re_irc> <> 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> <> I'm trying to write a USB enumerator in the API style like std::path and std::fs
<re_irc> <> Still in experiment:
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> <> firefrommoonlight: The frequency response of the human hearing is an incredibly complex pandora's box.
<re_irc> <> To a first degree the "perceived loudness vs frequency" is a function of absolute sound pressure level,
<re_irc> <> 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> <> 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> <> 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> <> (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> <> 9names: Thank you! Diving in
<re_irc> <> henrik_alser: Thank you for the details - looks like I have some reading (And later on experimenting!) to do
<re_irc> <> It also hits on several points that will come up later in the course of this project that I'd worried about
<re_irc> <> I'm copying+pasting your comment into the code as a comment...
<re_irc> <> Just ask if you need further pointers down the line!
<re_irc> <> 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> <> 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> <> I'm WAY over my head on this one, so that's going to happen!
<re_irc> <> I'm also trying to do a whole bunch of other weird stuff with this project I'll get into later
<re_irc> <> 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> <> 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> <> 404 :|
<cr1901> Also hi, jamesmunns, long time no see
<cr1901> at least on here
<re_irc> <> heyyo
<re_irc> <> they just pushed it, probably some cache lagging behind :P
<re_irc> <> 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> <> "me"
<re_irc> <> Message edits don't show up on the IRC bridge, I guess :D
<re_irc> <> (I'm usually much more active on , 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> <> heh
<re_irc> <> I don't do a lot of programming in my day job, unless something has gone seriously wrong :p
<re_irc> <> So I'm still living that "rust embedded in nights and weekend" life, personally.
fabic has joined #rust-embedded
<re_irc> <> 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> <> 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> <> Here are some different cheap options for pink noise generation
<re_irc> <> 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> <> From the way this DSP book is going, it seems like FFT and convolution will come together to make it happen
<re_irc> <> Since the coefficients for filters seem similar to convolution coeffs
<re_irc> <> Going to try to inpl those algos
<re_irc> <> Yeah FIR is convolution
fabic has quit [Ping timeout: 260 seconds]
<re_irc> <> Does anyone know how to turn this into a concise macro, ie without the boilerplate for each variable you make?
<re_irc> <> ```rust
<re_irc> <> static SURFACE: AtomicU8 = AtomicU8::new(0);
<re_irc> <> #[derive(Clone, Copy)]
<re_irc> <> I use enums all the time for operating modes etc, but want to manipulate them atomically instead of in a `Mutex`/CS
<re_irc> <> *actually, I'm not even sure what the API would be using a non-proc macro
<re_irc> <> maybe this
<re_irc> <> Although would have to fork etc since I don't think it's marked no_std
<re_irc> <> Anyone checked out the RTL8720 yet?
<re_irc> <> That isn't the chip they use in the wio terminal, is it?
<re_irc> <> 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> <> Looks like maybe some of it lives in the atsamd Hal? (That's the main MCU on the wio terminal)
<re_irc> <> James Munns: Ahh thanks!
<re_irc> <> Specifically the RTL8720DN, no idea if that makes a difference tho
<re_irc> <> not running rust *in* the rtl though right? :P
<re_irc> <> That would be too much fun i guess! What's a Real-M300 processor?
<re_irc> <> I was looking at a SOM like AI-thinker BW16
<re_irc> <> > It consists of a high-performance MCU (Armv8-M, Cortex-M33 instruction set compatible) called Real-M300
<re_irc> <> Looks like it has a M4F onboard
<re_irc> <> so ARMv8-m
<re_irc> <> but "cortex M33 instruction set compatible"
<re_irc> <> so it's a M33 or not? 🤣
<re_irc> <> Close enough for rock n roll?
<re_irc> <> they licensed the ISA but not the M33 verilog and rolled their own instead?
<re_irc> <> does ARM even let you do that?
<re_irc> <> (that post is for another similar chip, this one is just the real m300 it seems)
<re_irc> <> so uh
<re_irc> <> 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> <> Maybe better to focus on the ESP32-C3
<re_irc> <> yeah
<re_irc> <> sucky blob from manufacturer A vs sucky blob from manufacturer B
<re_irc> <> Uff, folks, can any1 help me think through potential groundloops? :/
<re_irc> <> I am totally unqualified for this and I am afraid :D
<re_irc> <> 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> <> Am I illegimately afraid or do I have to be careful?
<re_irc> <> (I burnt FTDIs in the past already)
<re_irc> <> put a bluetooth mcu in it instead :D
<re_irc> <> (I thought about using the C3 via WiFi to alleviate potential issues but then I still need the programmer)
<re_irc> <> yeah wont work I guess :D
<re_irc> <> Noah: What is it connected to?
<re_irc> <> USB Port of my PC <-> FTDI <-> UART <-> interface of the desk controller (no idea what's inside)
<re_irc> <> 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> <> Is there any downside to not have the GND wire as in potential fire
<re_irc> <> I feel so eternally stupid not understanding any of this as I have a degree in EE
<re_irc> <> if you need them to float to some common potential you can limit the current with resistors
<re_irc> <> which proves that universities are a joke :D
<re_irc> <> (the grading system; there is tons of qualified folks ofc)
jackneill has joined #rust-embedded
<re_irc> <> 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> <> I mean there is folks doing stuff like I try to already: e.g. and it does not feel like they care about ground anyways.
<re_irc> <> 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> <> Heh, will be funny when authorities are nocking on my door because I am spamming the spectrum :P
<re_irc> <> Which differential system do you mean? :/
<re_irc> <> the rs485
<re_irc> <> oh, tbh I am not sure if it's proper RS485
<re_irc> <> sorry I wrongly used it instead of UART
<re_irc> <> It's designed to be "groundless"
<re_irc> <> Oh so it's not rs485?
<re_irc> <> well it's just some kind of UART
<re_irc> <> I guess I cannot answer the specifics :/
<re_irc> <> I am about to find out tho :D
<re_irc> <> Ahh looks like normal uart then!
<re_irc> <> If only I bought my new overly expensive macbook already ground would not be an issue damn
<re_irc> <> Then you def need the ground wire :)
<re_irc> <> Sadge
<re_irc> <> so I wonder if I should just try and live with the consequences
<re_irc> <> 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> <> No worries!
<re_irc> <> Is it even connected to safety earth?
<re_irc> <> The desk? I am not sure lol
<re_irc> <> I could open the controller box
<re_irc> <> is it a 3 prong cord?
<re_irc> <> Ah yes, it is, but I wouldn't trust that :D
<re_irc> <> I have a linak controller and it isn't grounded
<re_irc> <> 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> <> wait no I lied
<re_irc> <> no earth
<re_irc> <> So just put them in the same power strip and you'll be safe
<re_irc> <> Cool, go ahead!
<re_irc> <> This will be an expensive experiment :D
<re_irc> <> I'll report when I finished soldering and everything is burning :FD
<re_irc> <> brb 5mins or so :D