#garfield Logs
Mar 08 2024
#garfield Calendar
04:06 AM Tom_L: https://ncviewer.com/
07:25 AM rue_mohr: Why do I always choose garbage day to take days off?
09:46 AM vii_majesty: hey
11:27 AM rue_mohr: hey
11:43 AM rue_mohr: so polprog if I have 8 analog inputs and 8 analog outputs I need an NN to correlate
11:43 AM rue_mohr: how much training data should I expect to need?
11:43 AM polprog: hard to say
11:44 AM polprog: if you just want to run a simple correlation then a few hundres samples is OK
11:44 AM rue_mohr: hmm
11:44 AM polprog: if you want to train a neural network like an autoencoder.. or something else then you need 100x that
11:44 AM rue_mohr: autoencoder/
11:44 AM rue_mohr: ?
11:46 AM polprog: its a type of neural network that "learns" how a signal looks like and then can extract it out from a noisy one
11:46 AM rue_mohr: hmm, that sounds like what I'm after
11:46 AM rue_mohr: but I could throw it a LOT of training data
11:48 AM polprog: https://github.com/turkdogan/autoencoder/blob/master/src/nn/autoencoder.cpp
11:48 AM polprog: this looks OK
11:48 AM polprog: the C++ is not necesary, he just wraps it into a class
11:49 AM polprog: the most difficult part is back propagation
11:50 AM polprog: https://mattmazur.com/2015/03/17/a-step-by-step-backpropagation-example/
11:50 AM polprog: this looks OK
11:50 AM polprog: gradient or partial derivative means rate of change of the value
11:50 AM rue_mohr: I could probably use the c++ to get the weights and then just use C to run it
11:50 AM polprog: or you could strip the c++ part and port it to C
11:51 AM polprog: yeah you do not want to train it on the microcontroller itself
11:51 AM polprog: you just want the weights
11:51 AM rue_mohr: well, nobody has a model that does continious learning so...
11:52 AM polprog: https://introml.mit.edu/_static/fall22/LectureNotes/chapter_Autoencoders.pdf
11:52 AM rue_mohr: I'll get more of the project ready, give me a year :]
11:52 AM polprog: hehe
11:53 AM polprog: this is a bit more advanced: https://web.stanford.edu/class/cs294a/sparseAutoencoder.pdf
11:58 AM rue_mohr: I need 2 things, a wrist cuff that measures muscle signals, and a set of bend sensors for a glove...
11:59 AM rue_mohr: the bend sensors come first for sure...
12:07 PM polprog: gotta run make supper..
12:08 PM rue_mohr: thought you said you needed to run a stepper for a second there
12:21 PM rue_mohr: http://192.168.9.12:/bbid/id.php?n=1234
12:21 PM rue_mohr: url format for possible breadboard ID system
12:22 PM rue_mohr: I have some programmable RF tags I wanted to use, but it was pointed out there are other ways too
02:35 PM WormFood: I have an FSK signal, that I need to decode with an avr. Which is just finding out the timing for each sine wave. The original hardware (a >1mhz 6809), uses an op-amp as a zero crossing detector, to convert the sine wave into a square wave. Would I need extra hardware on the AVR to achieve the same thing?
02:37 PM rue_mohr: use an FFT
02:37 PM rue_mohr: a 4 bin fft is really easy
02:38 PM rue_mohr: everything reduces to piffle
02:41 PM WormFood: This needs to be decoded in real time.
02:41 PM rue_mohr: yup
02:41 PM WormFood: And I don't need to determine what the 2 frequencies. I need to determine their order.
02:41 PM rue_mohr: a 4 bin fft is just a few multiplies
02:42 PM rue_mohr: the fft can tell you if its the high or low freq
02:43 PM rue_mohr: and it should be pretty noise resistant
02:43 PM WormFood: And what interface does it need? Does it work with just the on-board AVR hardware?
02:43 PM rue_mohr: if you feed it analog
02:43 PM rue_mohr: adc should do it
02:43 PM rue_mohr: how many cycles per bit?
02:43 PM rue_mohr: I mean, use a LM567 if you want :]
02:44 PM rue_mohr: or, there is a digital frequency detector I have
02:44 PM rue_mohr: does the signal have any noise?
02:44 PM WormFood: 1 cycle per bit
02:44 PM rue_mohr: oh
02:44 PM rue_mohr: probably not an fft then
02:44 PM WormFood: The signal should have minimal noise. It's being output through a 6 bit DAC
02:44 PM WormFood: that is why I questioned FFT :P
02:45 PM rue_mohr: hmm
02:45 PM rue_mohr: well
02:45 PM rue_mohr: where is my freqency detector circuit
02:45 PM WormFood: Didn't seem like the right tool for the job, but what do I know? I figured there was something you knew that I didn't
02:45 PM rue_mohr: implement it in software
02:45 PM WormFood: But like literally, it's one cycle per bit.
02:45 PM rue_mohr: its a... comparitor... uses...
02:46 PM rue_mohr: it uses a monostable and a D latch...
02:48 PM rue_mohr: ah frequeny boundry detector
02:48 PM rue_mohr: incomming
02:49 PM rue_mohr: http://ruemohr.org/~ircjunk/tempimage/p1300905.jpg
02:49 PM rue_mohr: easily implemented in code
02:57 PM WormFood: The original design, uses an op-amp as a zero crossing detector. So, as soon as the sine wave crosses zero volts, it changes it's state.
02:58 PM WormFood: that is in turn tied to an interrupt pin, so it can just use a timer or whatever to see how many cycles have passed, to determine if it's a 1 or a 0
03:02 PM WormFood: That is an interesting circuit, but I don't think it's gonna do what I need. I just need to figure out the timing on the sine wave. That doesn't require any complicated circuitry. At least not more than an op-amp
03:03 PM rue_shop2: it would probably reduce to resetting a timer and having an overflow at the middlepoint between the two time periods anyhow
03:03 PM rue_shop2: when converted to code
03:04 PM WormFood: https://colorcomputerarchive.com/repo/Documents/Manuals/Hardware/Color%20Computer%20Technical%20Reference%20Manual%20(Tandy).pdf Page 39 (pdf page, not page page)
03:05 PM WormFood: That will explain everything....well, not "everything", but you'll see what I'm working with.
03:08 PM WormFood: "The output circuit itilizes the 6-bit D/A to generate a sinewave of 1200 or 2400 baud" <-- what the fuck does that mean? Where does baud come into play here? Do they mean bit rate? And what is a "sinewave"? I guess they missed a space there, or maybe the used different words in the 70s/80s ;)
03:20 PM WormFood: So, in a nutshell, I want to capture the cassette output, as straight digital data. We already have software for the AVR that will play back these digital cassette files, but there is no way to record it.
03:20 PM WormFood: I need a way to test the cassette interface on these old computers, because when I sell one, I don't want a return because the fuckin' cassette port doesn't work right.
03:41 PM rue_shop2: hmm
03:41 PM rue_shop2: I used an impulse thing on mine...
03:42 PM rue_shop2: line printer? what?
03:43 PM rue_shop2: 32
03:44 PM rue_shop2: 1.2/2.4khz
03:44 PM rue_shop2: 1500 baud
03:45 PM rue_shop2: so you want a window at 1.8khz
03:45 PM rue_shop2: 556us
03:46 PM rue_shop2: so make that a compare match on the timer
03:46 PM rue_shop2: reset the timer when there is an edge
03:47 PM rue_shop2: if you get a compare, shift in a ... 1? and if you get another edge instead, shift in a ...0?
03:48 PM rue_shop2: can I write that for you?
03:48 PM rue_shop2: avr, right?
03:48 PM rue_shop2: 328p?
04:58 PM WormFood: Right, just start a timer when a level change occurs, and read the timer at the next level change, and see if it's a long or short pulse. Gather 8 bits, and write a byte. I should be able to write the code myself, plus I want to integrate it into existing software.
04:59 PM WormFood: But I didn't know the best way to read a signal, that should be about 1 volt, peak to peak, so that's like 1/2 volt above zero (and 1/2 volt below)
04:59 PM WormFood: I mean, read the signal, as in hardware sense.
05:26 PM WormFood: That url I gave you, has all the technical details of what I want to do, and what type of signals I'm working with. I need to record those signals. I can already play them back.
05:59 PM rue_mohr: no, use an interrupt on the threshold
05:59 PM rue_mohr: never wait for a timer that might not occur
06:00 PM rue_mohr: compare match vs rollover
06:00 PM rue_mohr: rollover kinda being a wtf
06:03 PM WormFood: I must not have made myself clear enough. Not waiting on a timer. Using the timer to measure the pulse width.
06:57 PM rue_mohr: I just dremeled an 8x slot into an infinity x slot
06:57 PM rue_mohr: pcie