Comb spectrum generation - diyAudio
Go Back   Home > Forums > Design & Build > Equipment & Tools

Equipment & Tools From test equipment to hand tools

Please consider donating to help us continue to serve you.

Ads on/off / Custom Title / More PMs / More album space / Advanced printing & mass image saving
Reply
 
Thread Tools Search this Thread
Old 3rd July 2008, 02:31 PM   #1
Elvee is online now Elvee  Belgium
diyAudio Member
 
Elvee's Avatar
 
Join Date: Sep 2006
Default Comb spectrum generation

Hi,

I would like to generate a digital signal having a comb-shaped spectrum.
The most obvious technique is to use a Dirac-like pulse, but I need some refinements: I would like the spectrum to be flat for the first 10 to 20 spectral lines, and I want the fundamental to be suppressed. For example, for 1KHz, I want 2, 3, 4, ..., 20KHz but not 1KHz. With a narrow pulse having a repetition rate of 1KHz, I'd get the unwanted 1KHz, and with 2KHz, I'd miss all the odd-numbered lines.
I would also like to have more useful energy than with a simple narrow pulse.
All this requires the construction of a particular sequence, with additional, well-placed transitions, and I would like to know that sequence, and also the process to compute it.

In fact, I need just the opposite of the "magic sinewaves". They contain the fundamental and no harmonics up to an arbitrary number, and I want no fundamental and all the harmonics.
http://www.tinaja.com/glib/msintro1.pdf
Thanks

LV
  Reply With Quote
Old 4th July 2008, 03:52 AM   #2
jcx is offline jcx  United States
diyAudio Member
 
Join Date: Feb 2003
Location: ..
my reading is that you want a binary sequence?

if so, create the spectrum with summed sines and then convert to PWM or even DSD style delta-sigma
  Reply With Quote
Old 4th July 2008, 08:03 AM   #3
Elvee is online now Elvee  Belgium
diyAudio Member
 
Elvee's Avatar
 
Join Date: Sep 2006
Quote:
Originally posted by jcx
my reading is that you want a binary sequence?
I do.

Quote:
if so, create the spectrum with summed sines and then convert to PWM or even DSD style delta-sigma
It is precisely the kind of complication I try to avoid: I'd have to generate 10 to 20 harmonically related frequencies and process them to obtain the signal.
But if I know the sequence, I can generate it much more simply, with purely digital means.
  Reply With Quote
Old 4th July 2008, 06:36 PM   #4
jcx is offline jcx  United States
diyAudio Member
 
Join Date: Feb 2003
Location: ..
i r a engineer, I could do this in LtSpice in < 1 Hr I could have a .wav for some reasonable sampling rate and test time

I couldn't tell you what an analytic or "simple" algorithmic solution would look like or if any such even exists in twice the time
  Reply With Quote
Old 6th July 2008, 05:12 PM   #5
Elvee is online now Elvee  Belgium
diyAudio Member
 
Elvee's Avatar
 
Join Date: Sep 2006
I've tried some simulations. The problem is, that for a given spectrum, there are an infinity of possible waveforms, depending on the initial phase of each harmonic. This means I can easily find a waveform fitting my spectral needs, but it's in no way optimum for hardware generation: i want the least possible transitions.
  Reply With Quote
Old 6th July 2008, 10:47 PM   #6
bwaslo is offline bwaslo  United States
diyAudio Member
 
bwaslo's Avatar
 
Join Date: May 2006
Location: Cinciinati, OH
You can use the Praxis software program (will run as freeware. download it from Liberty Instruments website) to generate any set of sinewaves you want at any amplitudes and starting phases, andmake a WAV file from them. Choose the "Fixed Tones (asynch)" type stimulus, go to the "waveform editor" and you'll get to the form to set up the tones and write it all out to the wav file. Pretty easy and often enlightening. (full disclosure note: Liberty Instruments and its web site is mine; but you can get and use the software free).

If you also need it to meet some other time domain requirements (such as minimum peak power, or something like that), you need more than generation software, you'll need something to optimize with. One way people have developed waves with certain spectra within limited peak levels is to first generate the spectral shape in the frequency domain, do an Inverse Fourier Transform back to time domain, cut off the peaks, then FFT back to frequency domain. Then fix the spectrum magnitude again (just set the magnitude values, but leave the phases intact), IFFT back to time again and clip the peaks, FFT back to frequenecy again and fix the spectra.....over and over till it (hopefully) converges toward what you want. I doubt you'll find existing software to do anything even remotely like that, you'll have to write it yourself, I think.
  Reply With Quote
Old 6th July 2008, 11:54 PM   #7
Banned
 
Join Date: Jan 2008
Blog Entries: 2
Default Re: Comb spectrum generation

Quote:
Originally posted by Elvee
I want no fundamental and all the harmonics.
I think that would be 1-sin(x) for x=0 to 180 degrees and -1-sin(x) for 180 to 360 degrees.

i.e. for 1kHz, a 1kHz square wave minus a 1kHz sine wave.

Now all you have to do is take the numbers for a max amplitude square wave ( +32767, -32767) and generate the appropriate number of samples for your chosen sampling rate by subtracting the maximum amplitude sine at each sampling instant from 32767 or -32767 as appropriate. You only have to calculate a quarter cycle.

@48kHz you require 48 samples for 1kHz. Once you have your values you can just repeat them endlessly... you only have to calculate 12 samples because of the symmetry.

w
  Reply With Quote
Old 7th July 2008, 12:55 AM   #8
bwaslo is offline bwaslo  United States
diyAudio Member
 
bwaslo's Avatar
 
Join Date: May 2006
Location: Cinciinati, OH
Quote:
Now all you have to do is take the numbers for a max amplitude square wave ( +32767, -32767) and generate the appropriate number of samples for your chosen sampling rate by subtracting the maximum amplitude sine at each sampling instant from 32767 or -32767 as appropriate. You only have to calculate a quarter cycle.
Yup, that'll work (sort of) if you are after only the odd harmonics. You will have to make sure your square wave frequency is an exact submultiple of the sample rate (i.e., 1kHz at 48kHz will work, but 1kHz at 44.1kHz won't). And the amplitude of the fundamental sinewave you'll be subtracting will be 4/pi times the peak amplitude of the square wave. So if you're using 16bit values you'll have to start with a square wave lower in amplitude than 32767 since the fundamental sine level has to be bigger than the square wave's. The third harmonic acts to decrease the peak amplitudes from the fundamental when making up a square wave. Or you can subtract a sinewave that is 2/pi in amplitude from the square wave twice.
  Reply With Quote
Old 7th July 2008, 12:57 AM   #9
Banned
 
Join Date: Jan 2008
Blog Entries: 2
I've taken the samples @ 7.5 degrees here, and offset the first sample by 3.75 degrees... half the sampling interval

Click the image to open in full size.

w
  Reply With Quote
Old 7th July 2008, 01:01 AM   #10
bwaslo is offline bwaslo  United States
diyAudio Member
 
bwaslo's Avatar
 
Join Date: May 2006
Location: Cinciinati, OH
I think if you do an FFT of that you'll find there is still significant energy there at the fundamental frequency.

See at
http://wiki.4hv.org/index.php/Fourier_Analysis
for the harmonic breakdown of a square wave
  Reply With Quote

Reply


Hide this!Advertise here!
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Flat comb spectrum Elvee Digital Source 0 1st July 2008 02:18 PM
Spectrum Analysis Spectrum of JX92s keladrin Full Range 2 26th May 2006 03:10 PM
FR125 / Comb effect CoryLee Full Range 17 12th June 2005 10:24 PM
Comb problem? eStatic Multi-Way 1 7th February 2004 02:25 PM
Hornloading, fatigue, comb filtering... walker Multi-Way 1 20th November 2001 09:55 AM


New To Site? Need Help?

All times are GMT. The time now is 08:21 PM.


vBulletin Optimisation provided by vB Optimise (Pro) - vBulletin Mods & Addons Copyright © 2014 DragonByte Technologies Ltd.
Copyright 1999-2014 diyAudio

Content Relevant URLs by vBSEO 3.3.2