Race Sim Central
Rec.Autos.Simulators Archive

Sim Experiment-- Engines in real time

18 posts by 7 people · 13 Apr 2003 00:41 UTC - 21 Apr 2003 22:26 UTC

J. Todd Wasson 13 Apr 2003 00:41 UTC#70678
I've often wondered if it would be possible to model an engine at a simple level in real time. What if you modelled eight (or whatever) pistons actually moving up and down in the cylinders, forcing air through the exhaust system to produce sound dynamically in real time? I decided to go ahead and give it a shot and see what it would sound like. What you're listening to in the samples below are various 5.7 liter V-8 engines with no exhaust headers (basically eight very short straight pipes): http://performancesimulations.com/files/EngineSoundModel.zip Physically based sound has been done before, of course. There was the Stacatto engine demo, which took an approach like this, but it's interesting how different this sounds. There is a lot of room for other stuff to be put in (I've got plenty of ideas). Keep in mind this is a relatively simple model :-D This might not run right on super fast computers. A friend of mine had problems on his 2.5Ghz system, but it ran fine on a couple of 1.1Ghz system at work as well as my 333Mhz laptop. Anyway, let me know what you think! Todd Wasson Racing Software http://PerformanceSimulations.com My car sim http://performancesimulations.com/scnshot4.htm
excellent work, some of the sounds were pretty darn convincing... I am very partial to the low rumble one I think it was file 12 or 13. Very big blockish. Don't try to run 2 of them at the same time though... mega crash.... ;-) Rich
Well that was a an interest play. Sounds pretty damn good to me. Doing sound this way would eliminate the looping wav files heard in other games. With thius you could easily develop a single cyclinder miss or like wise. Cya Nigel J. Todd Wasson <[email hidden]> wrote in message news:[email hidden]... > I've often wondered if it would be possible to model an engine at a simple > level in real time. What if you modelled eight (or whatever) pistonsactually > moving up and down in the cylinders, forcing air through the exhaustsystem to > produce sound dynamically in real time? > > I decided to go ahead and give it a shot and see what it would sound like. > What you're listening to in the samples below are various 5.7 liter V-8engines > with no exhaust headers (basically eight very short straight pipes): > > http://performancesimulations.com/files/EngineSoundModel.zip > > Physically based sound has been done before, of course. There was theStacatto > engine demo, which took an approach like this, but it's interesting how > different this sounds. There is a lot of room for other stuff to be putin > (I've got plenty of ideas). Keep in mind this is a relatively simplemodel :-D > > This might not run right on super fast computers. A friend of mine had > problems on his 2.5Ghz system, but it ran fine on a couple of 1.1Ghzsystem at
Quoted text (11 lines)> work as well as my 333Mhz laptop. > > Anyway, let me know what you think! > > > Todd Wasson > Racing Software > http://PerformanceSimulations.com > My car sim > http://performancesimulations.com/scnshot4.htm >
>Well that was a an interest play. Sounds pretty damn good to me. Doing >sound this way would eliminate the looping wav files heard in other games. >With thius you could easily develop a single cyclinder miss or like wise. >Cya >Nigel Thanks, Nigel. Actually I do have misses already in there, but it's not in any of the examples you heard. Next will be to model the rest of the exhaust system so you have resonances based on pipe lengths that will effect each cylinder as rarefraction and compression waves travel between the cylinders, helping or hindering cylinder filling depending on the exhaust configuration. I think you should be able to actually hear when the engine reaches peak torque this way. Right now there is no sound at all for 25% of each piston's travel. I.e., when the exhaust valve shuts, the sound stops. With the pipes in there the waves will continue bouncing around, producing some interesting changes throughout the speed range. Also, the cylinder filling is a bit random now, but should really change with engine speed of course as it follows the torque curve. That should really transform the sound as you rev up through the rpm's :-) This will probably be in my demo, scheduled to be released in 2413 ;-) Todd Wasson Racing Software http://PerformanceSimulations.com My car sim http://performancesimulations.com/scnshot4.htm
>excellent work, some of the sounds were pretty darn convincing... I am very >partial to the low rumble one I think it was file 12 or 13. Very big >blockish. Thanks :-) I like the sound of big, crackly racing engines the most too. >Don't try to run 2 of them at the same time though... mega crash.... ;-) > Hehe :-) Yes, that doesn't work very well! Todd Wasson Racing Software http://PerformanceSimulations.com My car sim http://performancesimulations.com/scnshot4.htm
The guys working on Live for Speed have nothing on you man. This sounds so much better than their "staccato" type sound engine. Maybe you should give them a call? Steve Mach42 J. Todd Wasson wrote:
Quoted text (32 lines)>>Well that was a an interest play. Sounds pretty damn good to me. Doing >>sound this way would eliminate the looping wav files heard in other games. >>With thius you could easily develop a single cyclinder miss or like wise. >>Cya >>Nigel > > > > Thanks, Nigel. Actually I do have misses already in there, but it's not in any > of the examples you heard. Next will be to model the rest of the exhaust > system so you have resonances based on pipe lengths that will effect each > cylinder as rarefraction and compression waves travel between the cylinders, > helping or hindering cylinder filling depending on the exhaust configuration. > I think you should be able to actually hear when the engine reaches peak torque > this way. Right now there is no sound at all for 25% of each piston's travel. > I.e., when the exhaust valve shuts, the sound stops. With the pipes in there > the waves will continue bouncing around, producing some interesting changes > throughout the speed range. > > Also, the cylinder filling is a bit random now, but should really change with > engine speed of course as it follows the torque curve. That should really > transform the sound as you rev up through the rpm's :-) > > This will probably be in my demo, scheduled to be released in 2413 ;-) > > > Todd Wasson > Racing Software > http://PerformanceSimulations.com > My car sim > http://performancesimulations.com/scnshot4.htm >
Are you going to model engine vibration too? To me this is the characterstic that really sets the sound of a V8 apart from a V12, for example. The vibration orders are the thing that is really different, otherwise it's all just rpm x no. of cylinders. Plus I have noticed that on race broadcasts you can really hear some harsh engine vibration on decels, which is something that I feel is missing from all the sims I have ever played. Seems like most sims use the same noise for accel and decel, but maybe filter it a bit and add backfire to the decels. It should be more different than that. "J. Todd Wasson" <[email hidden]> wrote in message news:[email hidden]... > > > Thanks, Nigel. Actually I do have misses already in there, but it's notin any > of the examples you heard. Next will be to model the rest of the exhaust > system so you have resonances based on pipe lengths that will effect each > cylinder as rarefraction and compression waves travel between thecylinders, > helping or hindering cylinder filling depending on the exhaustconfiguration. > I think you should be able to actually hear when the engine reaches peaktorque > this way. Right now there is no sound at all for 25% of each piston'stravel. > I.e., when the exhaust valve shuts, the sound stops. With the pipes inthere > the waves will continue bouncing around, producing some interestingchanges > throughout the speed range. > > Also, the cylinder filling is a bit random now, but should really changewith
Quoted text (12 lines)> engine speed of course as it follows the torque curve. That should really > transform the sound as you rev up through the rpm's :-) > > This will probably be in my demo, scheduled to be released in 2413 ;-) > > > Todd Wasson > Racing Software > http://PerformanceSimulations.com > My car sim > http://performancesimulations.com/scnshot4.htm >
Quoted text (11 lines)>Are you going to model engine vibration too? To me this is the >characterstic that really sets the sound of a V8 apart from a V12, for >example. The vibration orders are the thing that is really different, >otherwise it's all just rpm x no. of cylinders. Plus I have noticed that on >race broadcasts you can really hear some harsh engine vibration on decels, >which is something that I feel is missing from all the sims I have ever >played. Seems like most sims use the same noise for accel and decel, but >maybe filter it a bit and add backfire to the decels. It should be more >different than that. > >
Hmm.. Hadn't thought of engine vibration. Not really sure how to do it off the top of my head. This is pretty CPU hungry as it is and will get a lot worse with the whole exhaust system in there, but I'll think about it. What I think is definately missing is the little jumping around in rpm's you get when getting on or off the throttle like you mentioned. It think this is probably mostly due to gears engaging then bouncing off each other; almost like a flexing in the drivetrain. That's definately something I want to put in if it's not too CPU intensive. That adds so much to the sound. Plus, this would probably alter the sound quite a bit since it's accelerating and then decelerating with different amounts of cylinder filling in between the little "jumps." This sound actually changes based on how quickly the engine is accelerating/decelerating along with cylinder filling which can be controlled any way one's imagination allows, I suppose, so the off throttle sound can be very different. What you don't get here in the demos are part throttle effects. There's actually a smooth transition between full throttle and closed throttle, so you'd get a really different sound as you're coaxing the car through a corner while feathering the throttle. But yeah, I agree, there's something missing sound-wise from sims. Hopefully this is a step in the right direction though (I think it will be). Todd Wasson Racing Software http://PerformanceSimulations.com My car sim http://performancesimulations.com/scnshot4.htm
J. Todd Wasson wrote: > http://performancesimulations.com/files/EngineSoundModel.zip > > Physically based sound has been done before, of course. There was the Stacatto > engine demo, which took an approach like this, but it's interesting how > different this sounds. There is a lot of room for other stuff to be put in > (I've got plenty of ideas). Keep in mind this is a relatively simple model :-D Nice! From my first impression the sound would need some low-pass filtering... You know, I've been using commercial software that produces worse sound than that of your prototype, GT-Power... http://www.gtisoft.com/ They give you the opportunity to even model the sound based on the layout of the muffler. But it sound verrrry synthetic. What is your model based on? A first order simple thermodynamic ODE coupled to a stiff crankshaft which is represented by a second degree ODE which basically is Newton's equations, but for rotation? Or is it even simpler? From my own experience in modelling performed in scope of my own research in engine control I could advise you to use a parametric pressure model which probably will speed up your simulations a bit... It is described in SAE Technical Paper 2002-01-0371, written by Lars Eriksson and Ingemar Andersson. You could then try to model the rest of the dynamics in pipes and such by formulating differential equations and then discretizing these ending up with a computationally efficient recursion algorithm... It might work very nice indeed! /Stefan Larsson http://www.s2.chalmers.se/~last (remove nospam in e-mail to reply)
Absolutly Awesome,wow the hairs on the back of my head stood up,fantastic can't wait to hear this sound in a sim.regards skell "J. Todd Wasson" <[email hidden]> wrote in message news:[email hidden]... > I've often wondered if it would be possible to model an engine at a simple > level in real time. What if you modelled eight (or whatever) pistonsactually > moving up and down in the cylinders, forcing air through the exhaustsystem to > produce sound dynamically in real time? > > I decided to go ahead and give it a shot and see what it would sound like. > What you're listening to in the samples below are various 5.7 liter V-8engines > with no exhaust headers (basically eight very short straight pipes): > > http://performancesimulations.com/files/EngineSoundModel.zip > > Physically based sound has been done before, of course. There was theStacatto > engine demo, which took an approach like this, but it's interesting how > different this sounds. There is a lot of room for other stuff to be putin > (I've got plenty of ideas). Keep in mind this is a relatively simplemodel :-D > > This might not run right on super fast computers. A friend of mine had > problems on his 2.5Ghz system, but it ran fine on a couple of 1.1Ghzsystem at
Quoted text (11 lines)> work as well as my 333Mhz laptop. > > Anyway, let me know what you think! > > > Todd Wasson > Racing Software > http://PerformanceSimulations.com > My car sim > http://performancesimulations.com/scnshot4.htm >
J. Todd Wasson wrote: > Hmm.. Hadn't thought of engine vibration. Not really sure how to do it off > the top of my head. This is pretty CPU hungry as it is and will get a lot > worse with the whole exhaust system in there, but I'll think about it. You could maybe get some modelling inspiration from SAE Technical Paper 2000-01-0560: "Torque Estimation and Misfire Detection using Block Angular Acceleration", by Jeffrey K. Ball et al. /Stefan Larsson http://www.s2.chalmers.se/~last (remove nospam in e-mail to reply)
Quoted text (10 lines)>Nice! From my first impression the sound would need some low-pass >filtering... >You know, I've been using commercial software that produces worse sound >than that of your prototype, GT-Power... > >http://www.gtisoft.com/ > >They give you the opportunity to even model the sound based on the >layout of the muffler. But it sound verrrry synthetic. >
Interesting. I think it would be pretty simple to include a basic muffler model (at least a vibrating muffler anyway). I wonder how that would sound. This isn't a 3D system though like the gti software most likely is, so it's interesting that you find it sounding better even though it's far simpler, probably. >What is your model based on? A first order simple thermodynamic ODE >coupled to a stiff crankshaft which is represented >by a second degree ODE which basically is Newton's equations, but for >rotation? Or is it even simpler? > Simpler. Volume changes in the cylinder are controlled directly by engine speed, which itself is artificially changed in the demos. The acceleration you hear is constant through each gear and really just a special effect more than anything else in those demos. For driving sims, however, you should be able to simply feed the engine RPM directly into the sound function and let it do its thing. That's of course a function of all the car's setup parameters and so forth. The engine inertia, gearing, rotational acceleration is all part of the vehicle model, not the engine sound system. Basically, you say "for the next period of time where the sound buffer is being filled, spin the engine at xxx rpm and let it accelerate at xxx rpm/sec^2." The actual acceleration would be handled in the vehicle model. > From my own experience in modelling performed in scope of my own >research in engine control I could advise you to use a parametric >pressure model which probably will speed up your simulations a bit... It >is described in SAE Technical Paper 2002-01-0371, written by Lars >Eriksson and Ingemar Andersson. Thanks for the tip. I'll look into that. I have to keep in mind here though that those demos are running at over 88,000 hz and are done for eight cylinders. That's going to be at least 176,000 * number_of_operations per second per cylinder and per tube section, so the feasibility of having it run in real time with graphics and so on for a driving sim is yet to be seen. The current version would run just fine, I think. The full blown version of what I've got in mind would probably be great for a Playstation 3 or other rumored multi-processor systems possibly in planning, but it might need to be simplified a bit for PC games (which would still be beefed up from what you heard.) You could then try to model the rest of >the dynamics in pipes and such by formulating differential equations and >then discretizing these ending up with a computationally efficient >recursion algorithm... It might work very nice indeed! > I have no idea how to formulate a differential equation, let alone discretize it. I'd have to look that up in a dictionary to even know what you meant ;-) At least, if I've done it before, I didn't know that's what I was doing :-) Sort of like numerical integration, I guess... I'm not sure if this is the place for a recursive algorithm though because the number of nodes in the mesh might have to remain small. As it is, the demos only have 8 control volumes and 8 boundaries to an infinite volume constant pressure zone (one for each cylinder). What you're effectively hearing is the sound at the exhaust valve rather than at the end of any of the not-yet-implemented pipes. I've got a plan though for that already as far as linking pipes and so forth is concerned. If I'm missing your point though, please expand on it. Your thoughts on this are interesting, and I appreciate your compliments! Todd Wasson Racing Software http://PerformanceSimulations.com My car sim http://performancesimulations.com/scnshot4.htm
J. Todd Wasson wrote:
Quoted text (8 lines)>>They give you the opportunity to even model the sound based on the >>layout of the muffler. But it sound verrrry synthetic. > > Interesting. I think it would be pretty simple to include a basic muffler > model (at least a vibrating muffler anyway). I wonder how that would sound. > This isn't a 3D system though like the gti software most likely is, so it's > interesting that you find it sounding better even though it's far simpler, > probably.
But it might be more accurate for engineering... I haven't got the opportunity to compare with an engine that corresponds to the model. I've noticed a difference in approach between "gaming industry" and engineering.
Quoted text (12 lines)> Simpler. Volume changes in the cylinder are controlled directly by engine > speed, which itself is artificially changed in the demos. The acceleration you > hear is constant through each gear and really just a special effect more than > anything else in those demos. For driving sims, however, you should be able to > simply feed the engine RPM directly into the sound function and let it do its > thing. That's of course a function of all the car's setup parameters and so > forth. The engine inertia, gearing, rotational acceleration is all part of the > vehicle model, not the engine sound system. Basically, you say "for the next > period of time where the sound buffer is being filled, spin the engine at xxx > rpm and let it accelerate at xxx rpm/sec^2." > > The actual acceleration would be handled in the vehicle model.
Ok, I'm thinking in a very different way... Since I am working with dynamic systems every day it is natural for me to formulate everything as large models an then trying to simplify them using different model reduction methods. My idea was to simulate the engine as a simple system and just coupling the sound directly to the engine RPM. The engine dynamics would then be incorporated in the simulation of the engine as a whole.
Quoted text (10 lines)> Thanks for the tip. I'll look into that. I have to keep in mind here though > that those demos are running at over 88,000 hz and are done for eight > cylinders. That's going to be at least 176,000 * number_of_operations per > second per cylinder and per tube section, so the feasibility of having it run > in real time with graphics and so on for a driving sim is yet to be seen. The > current version would run just fine, I think. The full blown version of what > I've got in mind would probably be great for a Playstation 3 or other rumored > multi-processor systems possibly in planning, but it might need to be > simplified a bit for PC games (which would still be beefed up from what you > heard.)
88 kHz might be a bit high for physical simulations... But it might be possible to approximate the pressure variation in the cylinder using a cosine function, or even a quadratic function like x^2. I've already tried to play a sequence of synthesized pressures two years ago, but it didn't sound very good. Sounded much like playing abs(cos(x)). I think you should go for the full model and then simplify it by trying to get a grip of which components that matter.
Quoted text (9 lines)>>You could then try to model the rest of >>the dynamics in pipes and such by formulating differential equations and >>then discretizing these ending up with a computationally efficient >>recursion algorithm... It might work very nice indeed! > > I have no idea how to formulate a differential equation, let alone discretize > it. I'd have to look that up in a dictionary to even know what you meant ;-) > At least, if I've done it before, I didn't know that's what I was doing :-) > Sort of like numerical integration, I guess...
Yep... It's like numerical integration, but more general. If you formulate a linear continous differential system you can discretize it by e.g. first Laplace transform it and the apply a discretization transform into the Z-transform. Yes, I know it sounds horrible, but it is actually quite simple once you understand the what's behind the nomenclature.
Quoted text (7 lines)> I'm not sure if this is the place for a recursive algorithm though because the > number of nodes in the mesh might have to remain small. As it is, the demos > only have 8 control volumes and 8 boundaries to an infinite volume constant > pressure zone (one for each cylinder). What you're effectively hearing is the > sound at the exhaust valve rather than at the end of any of the > not-yet-implemented pipes. I've got a plan though for that already as far as > linking pipes and so forth is concerned.
By "recursive" I don't mean recursive in code, but in the algorithm... Like: y(k+1) = a0 * y(k) + a1 * y(k-1) + a2 * y(k-2) + ..., which will be calculated once for every iteration. It will depend on old values which already has been calculated which makes it efficent. The coefficients a0, a1, ... can be dependent of different states in the engine, like RPM, pressure an so forth... > If I'm missing your point though, please expand on it. Your thoughts on this > are interesting, and I appreciate your compliments! My point is that if you first formulate the physical system as a large system of differential equations (which is the hardest part) it is then quite simple to reduce it all into a couple of cryptic recursive equations as the one above that has to be calculated often enough. :) There are many known powerful methods for doing this. Hmm... I made a quick search in the SAE Digital Library and found: SAE 2000-25-0255, Interactive vehicle interior sound simulation. SAE 1999-01-1809, A sound simulation technique used for the predicition of passenger compartment noise. SAE 968054 , Simulation and sound quality evaluation of car interior noise for JARI driving simulator. SAE 951755 , Numerical simulation of exhaust flows and tailpipe noise of a small single-cylinder diesel engine. etc. etc... There seems to be a lot of literature on this subject. It appears that most of the simulation techniques are based on simulation of the flow of gas in the pipes. 1-D models seems to be sufficient. Some even includes Helmholtz resonance simulation (resonances in the intake pipes due to valve opening and closing if I remember right). Well, this do seem as a really interesting subject indeed! But I have to get back to work now. :( -- /S /* http://www.s2.chalmers.se/~last */ (remove "nospam" from email to reply)
Quoted text (12 lines)>J. Todd Wasson wrote: > >> Hmm.. Hadn't thought of engine vibration. Not really sure how to do it >off >> the top of my head. This is pretty CPU hungry as it is and will get a lot >> worse with the whole exhaust system in there, but I'll think about it. > >You could maybe get some modelling inspiration from SAE Technical Paper >2000-01-0560: "Torque Estimation and Misfire Detection using Block >Angular Acceleration", by Jeffrey K. Ball et al. > >/Stefan Larsson
Excellent paper! Thanks a lot. I went ahead and threw in some random vibration after reading it (yes, it sparked some ideas and inspiration; quite a lot actually :-D). I'm running this on my laptop both with and without mediocre quality headphones, so haven't heard what it sounds like on actual speakers. Is there any bass to this at all? I think I got rid of the static problem. Seems that the exhaust valves were not closing correctly. They sort of were and were not at the same time ;-) http://performancesimulations.com/files/ENGIN~18.EXE Todd Wasson Racing Software http://PerformanceSimulations.com My car sim http://performancesimulations.com/scnshot4.htm
J. Todd Wasson wrote: > Excellent paper! Thanks a lot. I went ahead and threw in some random > vibration after reading it (yes, it sparked some ideas and inspiration; quite a > lot actually :-D). I'm running this on my laptop both with and without > mediocre quality headphones, so haven't heard what it sounds like on actual > speakers. Is there any bass to this at all? Nice to be able to help! > I think I got rid of the static problem. Seems that the exhaust valves were > not closing correctly. They sort of were and were not at the same time ;-) > > http://performancesimulations.com/files/ENGIN~18.EXE It gets better and better! It is starting to sound very convincing, but still a bit synthetic. I guess you need some "slower" dynamics (variations) incorporated too? Keep up the good work! -- /S /* http://www.s2.chalmers.se/~last */ (remove "nospam" from email to reply)
Quoted text (21 lines)>> Excellent paper! Thanks a lot. I went ahead and threw in some random >> vibration after reading it (yes, it sparked some ideas and inspiration; >quite a >> lot actually :-D). I'm running this on my laptop both with and without >> mediocre quality headphones, so haven't heard what it sounds like on actual >> speakers. Is there any bass to this at all? > >Nice to be able to help! > >> I think I got rid of the static problem. Seems that the exhaust valves >were >> not closing correctly. They sort of were and were not at the same time ;-) >> >> http://performancesimulations.com/files/ENGIN~18.EXE > >It gets better and better! It is starting to sound very convincing, >but still a bit synthetic. I guess you need some "slower" dynamics >(variations) incorporated too? Keep up the good work! > >-- >/S
Thanks :-) This one is probably the worst one yet. Indeed, at higher rpm things don't sound as good. But the vibration stuff has got me thinking. I tried coding a rudimentary exhaust system last night, but really blew it. Will have to rethink that one again. Todd Wasson Racing Software http://PerformanceSimulations.com My car sim http://performancesimulations.com/scnshot4.htm

Sponsors

Affiliate Links

Sim Gaming Expo MOZA Racing Sim-Lab Fanatec TrakRacer Asetek Internet Privacy From NordVPN Dreamhost Capital One Credit Card Application Fanatical CDKeys Amazon Amazon UK Project Motor Racing iRacing Get your racing gloves, boots and more from Demon Tweeks. Enlist at Roberts Space Industries, developers of Star Citizen and Squadron 42


Back from the ashes since July, 2019. First created in 2001 with the merger of Legends Central (founded 1999) and simracing.dk.

A site by a sort of sim racer, for sim racers, about racing sims. News and information on both modern and historic sim racing software titles.

All products and licenses property of their respective owners.


Facebook Threads Bluesky Twitter Mastodon Instagram YouTube Tiktok Twitch Reddit Google News Apple News Subscribe via WordPress Flipboard eBay

Race Sim Central © 1999-2026 | Some links pay RSC a commission. Advertising does not equal endorsement.Cookie Policy