Jump to content

zimbot

Members
  • Posts

    9
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

zimbot's Achievements

Newbie

Newbie (1/4)

1

Reputation

  1. Just thinking this through... Starting with 100MHz sample rate (but only about ~30MHz bandwidth) measurements and 14bits, down-sampling to 768kHz is a factor of about 130 (close to 128) which would allow you to increase the effective bit depth by a little more than 7 additional bits. So that gets you up to between 21 and 22 bits, not 24 bits. This would work better if there is a little high-frequency noise in your starting signal, at a magnitude of about 1/2 a bit (kind of like dither). The result *might* be good enough, depending on your needs. Or, to get to full 24 bits, that would be a decimation factor of 10, and 2^10 = 1024, which pulls it down to just over the standard 96kHz sample rate. Other, off-the-shelf audio interfaces can do that with a lot less trouble (but whether any provides calibration quality at an affordable price is another question, which I cannot answer).
  2. I'm no expert, but I'll guess at an answer that might offer some insight. One thing that might not be obvious at first is that to do true FM, your oscillator will need to have a state variable, such as its instantaneous phase offset. I say it may not be obvious at first because you might instead try to just calculate the oscillator's output as a function of time, but then you would need to solve for the integral of everything that has led up to that moment in time to know exactly where the phase should be, else if you use a naive calculation then the modulation magnitude would increase with time and you get nonsense out. For each "next sample", you advance that phase offset by the appropriate amount of phase advance, which is the computed instantaneous frequency (the carrier frequency plus a small portion of the amplitude of the modulation signal at that same sample, + or -) optionally multiplied by 2π if you're going to use an actual sin() or cos() function (otherwise consider it normalized to the proportion of a full cycle, as when you're going to also multiply it by a table size when doing a table lookup) and divided by the sample rate. The output is then the sine (or cosine) at that updated phase offset, for which a table lookup is common for efficiency (though there are also fast approximations available). And you'll want to modulo the full cycle out of the phase offset to avoid loss of resolution when the phase offset gets too big. Sometimes it is acceptable and easier to just use phase modulation instead of frequency modulation, since you just add a portion of the modulation signal to the phase offset, along with the carrier frequency's own contribution. Oh, and you might find the music DSP mailing list archive helpful, such as here: Phase Modulation vs Frequency Modulation (YMMV). (if you see some random PI characters below, ignore them -- they keep being added back in each time I edit this to delete them)
×
×
  • Create New...