Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Simulation? Transistores? Signals? Tapes?  (Read 646 times)

Grey Goo

  • Bay Watcher
    • View Profile
    • The Metallic
Simulation? Transistores? Signals? Tapes?
« on: November 03, 2013, 08:34:47 am »

Hm, wonder really if people can give little advice/information with this...

I have long time programming project about simulating transistors and chips. Yes, simulating transistors and chips. Nothing fancy or too exact. Just something which works right. Most stuff are concepts and test code until enough information is gained. For now I have enough information about logical gates and how to send signals through those simulated transistores.

Yet there is some stuff about just those signals about what I don't have enough information for my taste. How exactly those signals moves and how theirs movements affects path of other signals? I am pretty sure just sending signal through path and wishing isn't working. Something else surely must happen for things like flip-flops, multiplexers, triggers and whatever to work properly.

In other words several small but important things. No, I don't accept Wikipedia articles. Already read most of them about this. Rather like to have something less of math and more of spatial concepts. Pictures and explanation are good, both even better. Just don't give animations. It is distracting trying make some sense about something which changes every 0.5 second. Just how it works when it comes to flow is that about I am trying make sense. Details, examples, etc.

So signal flow in it paths and probably how triggering plus other things works with transistors. Pretty sure concept is simple. Need not know about things like how different materials and such affects things. Not going simulate them anyway. Only signals.

And...

Also one more thing. Probably simplest one as of concept. I am also trying simulate those old cassette tapes, but while I am sure how to there is lots of math involved. I may have near full idea what are things to take account of are. First is signal is analog. This can be simulated if floating points are used. Because I am not good with math I rather ask someones give me simple formula, and I mean by simple readable by normal or abnormal people. However there is few factors to take to account:

1)Strength of signal and magnetic resistance with reading/writing.
2)Density of particles per square millimeter and probably quality of tape.
3)Width of tape for over reading/writing and generally fitting into recorder.
4)Size of recorder's head for making things interesting.

These are parameters how simulated surface must be read. In file/data-wise those which matters most are density and quality. More dense is bigger. On other hand lower quality kind of makes file smaller, but less accuracy. In other words, heck, this is kind of freaky file packing. Density=1D Image size? Either way, we now know something what kind of math is going involved. What about width? Hm, hard to explain. Planning it be more like favour and not affecting file size too much. Variable which somehow affects reading and writing.

Strength of signal is file/data-wise. Less chaotic signal, more clear? Magnetic resistance for sake of simplicity and affects whole operation. Recorder's head affects writing and reading. While favour, it may can be interesting.

Power... Running... Low... Must... Stop... Now...
Logged

Eagleon

  • Bay Watcher
    • View Profile
    • Soundcloud
Re: Simulation? Transistores? Signals? Tapes?
« Reply #1 on: November 03, 2013, 12:37:43 pm »

There's already a beautifully accurate analog simulator (open source, even!) known as SPICE, but I understand a desire to build a simulation yourself :) I would start with a basic electronics textbook, with a programmatic mindset - translate its concepts into many small prototype functions that you can connect together as you go. As generalizations are realized into modern understanding of electromagnetism, rework old functions to fit the new information. If something behaves differently from what you expect, realize that you're absolutely right in thinking there's more to circuit functionality than what you already know, but also realize you're working from the bottom up on an incredibly complicated problem and everything you've done already might be buggy. Work on one thing at a time until it matches as best you can tell what your source says in all your tests, and you'll get there eventually. Good luck!

(and if you're really itching to reinvent SPICE, which I say go for it, take a look at what it does and why, copy when you feel the need, but don't be afraid to apply your own insights into the process - you may just come up with something awesome that improves speed or accuracy for certain tasks)

For the second, I have a bit more useful information - in a reductionist sense (which most signal simulation uses, and why there's still lots of room for improvement), magnetic tape distortion is all about the AC bias effect cancelling (or failing to cancel) regions of zero magnetic strength (the bits of sound on magnetic tape are actually discrete points laid down by the recording head), plus the azimuth error (alignment of the play head with the surface of the tape), plus the tape speed limiting higher frequencies (source: http://artsites.ucsc.edu/ems/Music/tech_background/TE-19/teces_19.html). These can all be reduced to modifications to a waveform - a digital emulation, but digital can be very, very good if you're willing to go in-depth. Speaking as a musician, I and many others would love you forever if you made a good, free VST plugin, or even just a .wav file processor, simulating magnetic tape like this. All the other ones I know of are licensed or analog. If you wanted to emulate old cassettes whose binder has started deteriorating ('sticky-shed') it's probably a matter of slowing the tape slightly in a slight drag-pull pattern (two long superimposed forward-sloped sine waves, one much longer than the other in the same octave, is my completely ass-pulled guess) to emulate the warbling it produces http://www.youtube.com/watch?v=Yw8XWPTmX3o - this guy bitches about it like crazy, but I use esoteric effects like that all the time out of pure self-indulgent eccentricity *butterflies!*

But I also understand the desire to go with a more bottom-up approach. Actually, I'm not aware of any publically available simulation that does this, so you might be edging in on some professional's guarded territory ;) Magnetic tape is still used for backup by Google! You could be the guy that sparks people to improve it further using new materials.

I would start with the tape itself - how much magnetic flux it can store per unit of measurement (I would stick with real ones for all of them, that way you can tweak it to closely match reality and I can tweak them to match my madness :D), how quickly it moves through the deck, and for shits and giggles, how long the spool is combined with how much drag the wheel that levels it out produces on the tape speed towards the beginning of the tape, when resistance is strongest. The recording head size (specifically its gap) combined with the tape speed is very important for the frequency limit - it determines the highest frequency your tape can record without modification after the fact. I don't know the specific equations for this, but it probably involves some higher maths - make a fudge that produces something fairly close to actual audio, and come back, because then you'll have a baseline for the next step. After that is the read head - I wouldn't worry about the eraser, other than to apply its erasing frequency to the whole of the tape. For that you'd need a proportionally higher sample-rate, like 176400hz, which is ridiculous by any sane person's standards but still available.

The read operation seems like a fairly straightforward conversion - magnetic incidence producing periodic electrical impulses. It could be further improved by the simulation of azimuth - that is a matter of waveform interference, not only of amplitude but frequency as well, as the higher frequencies blend together into larger magnetic features on the tape. Two spots should combine into an entirely different waveform. For this, I would suggest you look at the combination of two square waves (one offset by a different phase) and two much lower-amplitude sine waves of the same frequencies and phase in your favorite audio editor - Audacity is nice for this kind of experiment. Their peaks and troughs as their frequencies increase/decrease, together or seperately, might maybe closely represent the transformation you'd have to apply on the amplitude of each discrete point as azimuth error increases, possibly with very bad error resulting in a blip of an incorrectly detected signal. This is beyond my math knowledge :(

The AC bias effect cancelling out areas of zero gain is what baffles me the most. I don't honestly know how you'd emulate it in software. It's a matter of what levels the play head is capable of reading - but everything else should play normally. Maybe a weird filter that extends out zero-crossing points after the recording process as the gain decreases would be your best bet?

Good luck! And sorry for wikipedia =P It's there to provide reference to what the hell I'm talking about for concepts that I had to look up - if you need me to explain anything further, just ask. Keep in mind that I'm not a professional either - most of this is coming from a fairly loose understanding of DSP and digital audio tooled to produce the batshit noise I enjoy.
Logged
Agora: open-source, next-gen online discussions with formal outcomes!
Music, Ballpoint
Support 100% Emigration, Everyone Walking Around Confused Forever 2044