I'm doing some audio programming to be used in a flight trainer. Previously, directsound was being used to perform all audio playback. Now though, due to the need to do realtime capture and playback, we've switched to using ASIO because of the low latency associated with it. Anyway, Directsound had methods for doing things like volume, pan, and frequency control, but now with ASIO, this has to be done manually (by me ;) ). I understand volume and pan control, but i can't seem to find any web resources that discuss frequency shifting in enough detail for me to come up with at least a basic algorithm. I understand that this is probably not a simple topic, but i'd like to be able to get started with this even if performance/quality is not optimized. Can anyone suggest a website that discusses this in some detail, with or without sample C/C++ code (my background is computer/electrical engineering, so i can understand anything meant for an undergrad level course and maybe a little beyond that)? Or if someone can explain the concept of frequency shifting. Thanks a lot, david
frequency/pitch shifting
Started by ●April 20, 2004
Reply by ●April 21, 20042004-04-21
http://www.dspdimension.com/start.html -- "Things should be described as simply as possible, but no simpler." A. Einstein
Reply by ●April 21, 20042004-04-21
David, first you should be clear about what you actually want to achieve. A frequency shift shifts all frequencies in a sound by the same amount in Hz, distorting it in an "unnatural" way. A pitch shift does not - ideally, it will shift the perceived pitch on a note scale to become sharp or flat. Feel free to visit my web site at http://www.dspdimension.com for more information. --smb
Reply by ●April 21, 20042004-04-21
Stephan M. Bernsee wrote:> David, > > first you should be clear about what you actually want to achieve. > > A frequency shift shifts all frequencies in a sound by the same amount > in Hz, distorting it in an "unnatural" way. A pitch shift does not - > ideally, it will shift the perceived pitch on a note scale to become > sharp or flat. > > Feel free to visit my web site at http://www.dspdimension.com for more > information.Good to see you here again Stephan! Would you care to tell us where your GPL scaling library stands? Bob -- "Things should be described as simply as possible, but no simpler." A. Einstein
Reply by ●April 21, 20042004-04-21
Bob Cain wrote in message news:> > Good to see you here again Stephan! Would you care to tell > us where your GPL scaling library stands? >...on http://www.clearscale.org...? ;-) I'll be working on it over the summer. Right now I have some of my students collect some test files and write up a batch script to test various methods, which is rather tedious if you do it manually. But I already have a working prototype that I'm going to test further and I'll update the page as I go. Also, I'll most probably be at the Linux Audio developer conference held next week in Karlsruhe/ZKM to talk about the latest development in this regard. The link is http://www.zkm.de/lad (I'm not on the list of speakers because I learned about the LAD in February - I'm just there for a chat). Regards, --smb
Reply by ●April 21, 20042004-04-21
Yes, thank you stephan. I meant to write back saying that i want to do pitch shifting. An example of this would be scaling the pitch of an engine sound so that if the scale factor is > 1 the engine sounds as if its going "faster", and if it's less than one, it sounds "slower". I've checked out dspdimension, and a few other sites, including clearscale. David "Stephan M. Bernsee" <stephan.bernsee@web.de> wrote in message news:38ab652c.0404202125.22e6904@posting.google.com...> David, > > first you should be clear about what you actually want to achieve. > > A frequency shift shifts all frequencies in a sound by the same amount > in Hz, distorting it in an "unnatural" way. A pitch shift does not - > ideally, it will shift the perceived pitch on a note scale to become > sharp or flat. > > Feel free to visit my web site at http://www.dspdimension.com for more > information. > > --smb
Reply by ●April 21, 20042004-04-21
Well, considering the fact that a motor noise is a cyclostationary signal rather than a (musically) harmonic signal and since you indicate that you wish to increase the "speed" of that cycle, maybe a sample rate conversion to transpose it (musically speaking) would be better suited? Pitch shifting will only change the pitch, not the cycle. IOW: it will not sound faster, just higher... I'm not sure if that is what you want, considering the application... --smb "David Reid" wrote in message> Yes, thank you stephan. I meant to write back saying that i want to do > pitch shifting. > > An example of this would be scaling the pitch of an engine sound so that if > the scale factor is > 1 the engine sounds as if its going "faster", and if > it's less than one, it sounds "slower". > > I've checked out dspdimension, and a few other sites, including clearscale. > > David
Reply by ●April 21, 20042004-04-21
Well, i think that's what DirectSound allows you to do when you change the buffer frequency. If the sample rate of the sound is 44100 and you multiply by 1.08 approx, the buffer will now contain data for 48kHz playback, which when played back at 44.1kHz would yield a "faster" sound. This method was acceptable for the company so that's what im trying to achieve but using a different sound API (ASIO). So i have to do the sample rate conversions myself. I've started looking at the osalp on sourceforge, it has a class that does sample rate conversions. i think that will be good enough for what i want to do, but we'll see how it goes. Thanks for all your help. "Stephan M. Bernsee" <stephan.bernsee@web.de> wrote in message news:38ab652c.0404210941.59373723@posting.google.com...> Well, considering the fact that a motor noise is a cyclostationary > signal rather than a (musically) harmonic signal and since you > indicate that you wish to increase the "speed" of that cycle, maybe a > sample rate conversion to transpose it (musically speaking) would be > better suited? > > Pitch shifting will only change the pitch, not the cycle. IOW: it will > not sound faster, just higher... I'm not sure if that is what you > want, considering the application... > > --smb > > "David Reid" wrote in message > > Yes, thank you stephan. I meant to write back saying that i want to do > > pitch shifting. > > > > An example of this would be scaling the pitch of an engine sound so thatif> > the scale factor is > 1 the engine sounds as if its going "faster", andif> > it's less than one, it sounds "slower". > > > > I've checked out dspdimension, and a few other sites, includingclearscale.> > > > David
Reply by ●April 22, 20042004-04-22
Stephan M. Bernsee wrote:> Bob Cain wrote in message news: > >>Good to see you here again Stephan! Would you care to tell >>us where your GPL scaling library stands? >> > > > ...on http://www.clearscale.org...? > > ;-) > > I'll be working on it over the summer. Right now I have some of my > students collect some test files and write up a batch script to test > various methods, which is rather tedious if you do it manually. But I > already have a working prototype that I'm going to test further and > I'll update the page as I go. > > Also, I'll most probably be at the Linux Audio developer conference > held next week in Karlsruhe/ZKM to talk about the latest development > in this regard. > > The link is http://www.zkm.de/lad (I'm not on the list of speakers > because I learned about the LAD in February - I'm just there for a > chat). >Thanks, I can't tell you how much I applaud your willingness to take this on. There is such a dearth of high quality public domain technology for this. Many projects will benefit. Many Thanks, Bob -- "Things should be described as simply as possible, but no simpler." A. Einstein
Reply by ●April 22, 20042004-04-22