Home of the Squeezebox™ & Transporter® network music players.
Results 1 to 10 of 10
  1. #1
    Junior Member
    Join Date
    Oct 2006
    Posts
    2

    Signal generator plugin

    Hi,

    I was going to write a plugin to do simple signal generator. I did not find such a plugin, but I thought its best to ask before I start..

    All I need for the first phase is a plugin that generates a sine wave with a frequency that can be controlled from the remote.

    does anyone know about such a plugin?

    together with a cheap SPL meter, this can be a powerful tool to get started with room treatment.

    Thanks,
    Or Tal
    ortal99@gmail.com

  2. #2
    Senior Member
    Join Date
    Oct 2005
    Posts
    7,103
    That sounds like a great idea!

  3. #3
    Senior Member
    Join Date
    Jul 2005
    Location
    Massachusetts
    Posts
    290
    ortal - I don't know whether you got around to this. But in case you didn't: the latest version of the InguzEQ/DSP now includes a signal generator.

    It's pretty flexible (see http://inguzaudio.com/usage/plugin/s...s/test-signals) but right now most of the tones default to 1kHz (because I'm still struggling to write a "choose a frequency" mode in the plugin).

  4. #4
    Senior Member
    Join Date
    Apr 2005
    Posts
    8,410
    You might like to try the attached - a purl perl plugin which I've just been working on.

    buttons in signal generator mode:
    1 - function [sine, square, triangle, sawtooth]
    2/5 - signal gain
    3 - channel
    4 - sample rate
    6 - bit depth
    up/down fwd/rew for changing the frequency

    Please note this can generate full volume waveforms so please be careful with the volume control if you are playing it though your loudspeakers/headphones. [It was intended for lab testing of my dac so it will play full amplitude samples]

    Feedback appreciated on how accurate & useful it is.

    Adrian

  5. #5
    Senior Member
    Join Date
    Jul 2005
    Location
    Massachusetts
    Posts
    290
    Nice job, triode. It's small and simple.

    Beware the square/triange/sawtooth though - I made the same mistake. If you make a "digital square wave" by alternating a stream of +1 and -1 samples (so it looks like a perfect square wave), you get a lot of really nasty non-harmonic artifacts due to aliasing. On the other hand, if you make a square wave and then filter down to the sample rate, you get a signal that has all the right harmonics and no non-harmonic content (up to half the sampling rate), but it doesn't look square when you look at the digital waveform.

    It's quite easy to tell the difference by listening, too.

    Whether this is any sort of a big deal depends what you want to use the signals for. If you're doing distortion analysis you'll want the band-limited version.

    Some examples:
    2205Hz raw square: WAV and scope image
    2205Hz band-limited square: WAV and scope image

  6. #6
    Senior Member
    Join Date
    Apr 2005
    Posts
    8,410

    Signal generator plugin

    > Beware the square/triange/sawtooth though - I made the same mistake.
    > If you make a "digital square wave" by alternating a stream of +1 and
    > -1 samples (so it looks like a perfect square wave), you get a lot of
    > really nasty non-harmonic artifacts due to aliasing. On the other
    > hand, if you make a square wave and then filter down to the sample
    > rate, you get a signal that has all the right harmonics and no
    > non-harmonic content (up to half the sampling rate), but it doesn't
    > look square when you look at the digital waveform.


    I think there are actually a couple of bugs in the plugin I posted. If
    people are interested I can post the latest one to the wiki.

    I've been using this as a signal generator for viewing output on a scope.
    To get the cleanest waveforms the plugin alters the frequency so that the
    period of the signal is always an integral number of samples. I think this
    minimises this effect, but yes there is probably some residual harmonic
    distortion.



  7. #7
    Senior Member
    Join Date
    Jul 2005
    Location
    Massachusetts
    Posts
    290
    Snapping to the nearest frequency where period is an *even* number of samples is quite smart. (Integral: almost, for example a square wave should never have any 2nd harmonic content, but it would here).

    Bah, my raw square has a even-harmonics bug even worse than this one: for a 2205Hz square I get 9 samples +1 and 11 samples at -1. Oh dear :-)

    I make band-limited versions by summing sine waves of the various harmonics in appropriate ratios/phases, up to samplingrate/2. Which works great, but at low frequencies it's really expensive to compute. The BLIT paper (http://www-ccrma.stanford.edu/~stilti/papers/blit.pdf) gives a more efficient method (but harder to code...)

  8. #8
    Senior Member
    Join Date
    Apr 2009
    Location
    Germany
    Posts
    299
    Hi,

    i've tried out the signel generator plugin just offered under "plugins" by SBS 7.4. Is this the plugin youre talking about ?

    Nice piece of software, but i can't manage to get any sinus output above 12 kHz on both SB3 and Boom. It the SB hardware too slow for these frequencies ?

    My ears are still in a condition to hear 15 kHz from a test CD, only the SB plugin suffers above 12 kHz.

    Any ideas ?

    regards
    Roger
    SB Touch
    SB Boom
    SB Radio
    Thinkpad T530, Win 7 Pro 64bit, LMS 7.9

  9. #9
    Senior Member
    Join Date
    Apr 2005
    Posts
    8,410
    Roger, I suspect this is due to the snapping to the nearest frequency feature which is discussed above. At frequencies close to the sampling rate the plugin will become less accurate in terms of frequency as it is trying to create the most accurate waveform it can with simple maths.

    What happens if you change the sampling frequency to 48k (or 96k if you have a transporter)?

    I don't have a working scope at present so can't really test in detail. I believe if you enable debugging you will see what the actual period it thinks it is creating through and this should give you a good indication of what frequency the plugin is creating.

  10. #10
    Senior Member
    Join Date
    Apr 2009
    Location
    Germany
    Posts
    299
    Quote Originally Posted by Triode View Post
    What happens if you change the sampling frequency to 48k (or 96k if you have a transporter)?
    Changing to 48 kHz (I only have a SB3) gives only a little higher output at 14 kHz, but still near silence. With a dedicated test CD I can hear up to 16 kHz without a problem.
    SB Touch
    SB Boom
    SB Radio
    Thinkpad T530, Win 7 Pro 64bit, LMS 7.9

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •