<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:p="urn:schemas-microsoft-com:office:powerpoint" xmlns:a="urn:schemas-microsoft-com:office:access" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:s="uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882" xmlns:rs="urn:schemas-microsoft-com:rowset" xmlns:z="#RowsetSchema" xmlns:b="urn:schemas-microsoft-com:office:publisher" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" xmlns:c="urn:schemas-microsoft-com:office:component:spreadsheet" xmlns:odc="urn:schemas-microsoft-com:office:odc" xmlns:oa="urn:schemas-microsoft-com:office:activation" xmlns:html="http://www.w3.org/TR/REC-html40" xmlns:q="http://schemas.xmlsoap.org/soap/envelope/" xmlns:D="DAV:" xmlns:x2="http://schemas.microsoft.com/office/excel/2003/xml" xmlns:ois="http://schemas.microsoft.com/sharepoint/soap/ois/" xmlns:dir="http://schemas.microsoft.com/sharepoint/soap/directory/" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:dsp="http://schemas.microsoft.com/sharepoint/dsp" xmlns:udc="http://schemas.microsoft.com/data/udc" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:sub="http://schemas.microsoft.com/sharepoint/soap/2002/1/alerts/" xmlns:ec="http://www.w3.org/2001/04/xmlenc#" xmlns:sp="http://schemas.microsoft.com/sharepoint/" xmlns:sps="http://schemas.microsoft.com/sharepoint/soap/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:udcs="http://schemas.microsoft.com/data/udc/soap" xmlns:udcxf="http://schemas.microsoft.com/data/udc/xmlfile" xmlns:udcp2p="http://schemas.microsoft.com/data/udc/parttopart" xmlns:wf="http://schemas.microsoft.com/sharepoint/soap/workflow/" xmlns:dsss="http://schemas.microsoft.com/office/2006/digsig-setup" xmlns:dssi="http://schemas.microsoft.com/office/2006/digsig" xmlns:mdssi="http://schemas.openxmlformats.org/package/2006/digital-signature" xmlns:mver="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns:mrels="http://schemas.openxmlformats.org/package/2006/relationships" xmlns:spwp="http://microsoft.com/sharepoint/webpartpages" xmlns:ex12t="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:ex12m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:pptsl="http://schemas.microsoft.com/sharepoint/soap/SlideLibrary/" xmlns:spsl="http://microsoft.com/webservices/SharePointPortalServer/PublishedLinksService" xmlns:Z="urn:schemas-microsoft-com:" xmlns:st="" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.MsoPlainText, li.MsoPlainText, div.MsoPlainText
        {mso-style-priority:99;
        mso-style-link:"Plain Text Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:10.5pt;
        font-family:Consolas;}
span.EmailStyle17
        {mso-style-type:personal;
        font-family:"Arial","sans-serif";
        color:windowtext;}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.PlainTextChar
        {mso-style-name:"Plain Text Char";
        mso-style-priority:99;
        mso-style-link:"Plain Text";
        font-family:Consolas;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page Section1
        {size:595.3pt 841.9pt;
        margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.Section1
        {page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]-->
</head>

<body lang=EN-GB link=blue vlink=purple>

<div class=Section1>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>I can offer some tips sent into the SDIY list recently from the
great Antti Huovilainen<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><a href="http://antti.smartelectronix.com/">http://antti.smartelectronix.com/</a><o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>also <a
href="http://www.diy.synth.net/gallery/main.php?g2_itemId=1078">http://www.diy.synth.net/gallery/main.php?g2_itemId=1078</a> 
Synth DIY UK 2006<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Some DSP theory links here: http://www.chameleon.synth.net/english/links.shtml<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>

<p class=MsoPlainText>> I'm curious, what approach are you using to get
'alias free' oscillators? <o:p></o:p></p>

<p class=MsoPlainText>> Simply using a much higher internal sampling rate
and then a low pass <o:p></o:p></p>

<p class=MsoPlainText>> FIR filter?  Or something more sophisticated
than this.<o:p></o:p></p>

<p class=MsoPlainText><o:p> </o:p></p>

<p class=MsoPlainText>Since this question gets asked a lot, I'll list some of
the common methods. Roughly from easy to hard. Oversampling here means proper
oversampling with high quality lowpass filtering before decimating to target samplerate.
Simply averaging N samples will not work.<o:p></o:p></p>

<p class=MsoPlainText><o:p> </o:p></p>

<p class=MsoPlainText>1) Trivial saw with oversampling<o:p></o:p></p>

<p class=MsoPlainText>Pros: Easy, can do any waveshape, allows simple sync and
FM<o:p></o:p></p>

<p class=MsoPlainText>Cons: Requires massive (64..256x) oversampling to sound
good<o:p></o:p></p>

<p class=MsoPlainText><o:p> </o:p></p>

<p class=MsoPlainText>2) Sum of sines<o:p></o:p></p>

<p class=MsoPlainText>Sum nyquist/freq number of sines to produce exactly
bandlimited sawtooth.<o:p></o:p></p>

<p class=MsoPlainText>Pros: No aliasing<o:p></o:p></p>

<p class=MsoPlainText>Cons: Too slow to be of use in practise.<o:p></o:p></p>

<p class=MsoPlainText><o:p> </o:p></p>

<p class=MsoPlainText>3a) Differentiated parabole wave<o:p></o:p></p>

<p class=MsoPlainText>Synthesize parabole (diff(phase^2)*1/freq for -1 <=
phase < 1). Aliasing falls at 12dB/oct (compared to 6dB/oct for trivial
saw).<o:p></o:p></p>

<p class=MsoPlainText><o:p> </o:p></p>

<p class=MsoPlainText>Pros: Almost as easy as trivial saw. 1/freq can be
derived from interpolated table lookup (store 1/freq for each note)<o:p></o:p></p>

<p class=MsoPlainText>Cons: diff(phase^2) can get very small for low
frequencies requiring 24 or<o:p></o:p></p>

<p class=MsoPlainText>32 bit resolution. Requires 1.5-2x oversampling to avoid
annoying warble between 10-20 kHz.<o:p></o:p></p>

<p class=MsoPlainText><o:p> </o:p></p>

<p class=MsoPlainText>3b) Slewrate limited saw<o:p></o:p></p>

<p class=MsoPlainText>Use a trivial saw-tri pwm oscillator with the pulse width
set to exactly one sample. Can be shown to be equivalent to 2a.<o:p></o:p></p>

<p class=MsoPlainText><o:p> </o:p></p>

<p class=MsoPlainText>Pros: Doesn't require frequency dependent scaling or high
resolution computations.<o:p></o:p></p>

<p class=MsoPlainText>Cons: Same as 3a<o:p></o:p></p>

<p class=MsoPlainText><o:p> </o:p></p>

<p class=MsoPlainText>3c) Other waveshaping methods<o:p></o:p></p>

<p class=MsoPlainText>Several other methods can be used to sample a smooth
function and then warp the spectrum to resemble saw. Generally slower and more
complicated than 2a or 2b.<o:p></o:p></p>

<p class=MsoPlainText><o:p> </o:p></p>

<p class=MsoPlainText>4) Mipmapped wavetables<o:p></o:p></p>

<p class=MsoPlainText>Precalculate a version (mipmap) for each octave (or half
octave) with exact number of harmonics. Select nearest mipmap and interpolate
the stored waveform on playback.<o:p></o:p></p>

<p class=MsoPlainText><o:p> </o:p></p>

<p class=MsoPlainText>Pros: Good quality with higher order interpolator or
oversampling mipmaps. <o:p></o:p></p>

<p class=MsoPlainText>Can do arbitrary waveforms. Easy FM. Easy phase
distortion.<o:p></o:p></p>

<p class=MsoPlainText>Cons: Needs lots of memory. Number of harmonics limited
for low notes. <o:p></o:p></p>

<p class=MsoPlainText>Requires oversampling the mipmaps (using longer table
than strictly required by the number of stored harmonics) or using high order
(FIR) interpolator. Requires oversampling or more mipmaps (half or quarter<o:p></o:p></p>

<p class=MsoPlainText>octave) to avoid missing frequencies between 15-20 kHz.<o:p></o:p></p>

<p class=MsoPlainText><o:p> </o:p></p>

<p class=MsoPlainText>5a) BandLimited Impulse Trains (BLIT)<o:p></o:p></p>

<p class=MsoPlainText>Synthesize bandlimited impulse train and integrate that
to produce saw.<o:p></o:p></p>

<p class=MsoPlainText><o:p> </o:p></p>

<p class=MsoPlainText>Pros: Good quality. No oversampling required.<o:p></o:p></p>

<p class=MsoPlainText>Cons: Complicated, slow, has numerical issues. Difficult
to do FM, PWM or sync.<o:p></o:p></p>

<p class=MsoPlainText><o:p> </o:p></p>

<p class=MsoPlainText>5b) BandLimited StEps (BLEP)<o:p></o:p></p>

<p class=MsoPlainText>For each oscillator reset, sum a bandlimited step with
the trivial saw. <o:p></o:p></p>

<p class=MsoPlainText>The steps are precalculated and stored in a table (can be
quite short when interpolation is used between two phases.<o:p></o:p></p>

<p class=MsoPlainText><o:p> </o:p></p>

<p class=MsoPlainText>Pros: Very good quality. No oversampling required. Can do
bandlimited FM, PWM and sync. Probably the only method that can do audio rate
PWM and sync.<o:p></o:p></p>

<p class=MsoPlainText>Cons: Requires a divide per cycle. Can be complicated:
calculating required table entry is not trivial when using sync or pwm.<o:p></o:p></p>

<p class=MsoPlainText><o:p> </o:p></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>HTH<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Chris<o:p></o:p></span></p>

</div>

</body>

</html>