<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: HOWTO: a &#8220;Perfect Reconstruction&#8221; Graphic Equalizer</title>
	<atom:link href="http://hostilefork.com/2007/12/16/perfect-reconstruction-equalizer/feed/" rel="self" type="application/rss+xml" />
	<link>http://hostilefork.com/2007/12/16/perfect-reconstruction-equalizer/</link>
	<description>a disgruntled developer taking a stand in the information multiverse</description>
	<pubDate>Fri, 21 Nov 2008 04:31:25 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5</generator>
		<item>
		<title>By: Dave H</title>
		<link>http://hostilefork.com/2007/12/16/perfect-reconstruction-equalizer/#comment-783</link>
		<dc:creator>Dave H</dc:creator>
		<pubDate>Wed, 29 Oct 2008 20:01:21 +0000</pubDate>
		<guid isPermaLink="false">http://hostilefork.com/2007/12/16/perfect-reconstruction-equalizer/#comment-783</guid>
		<description>O.K. just a quick followup. I got this to work, and a single pulse can be reconstructed! The problem was that the descending cascade of FIR filters were creating an ever increasing delay. This needs to be compensated with a large delay for the first (top) band and decreasing through to nothing for the lower bands.
I've got 6 bands with a 12 point (SSE) FIR's running at about 15% of my P4 cpu, which isn't great, but I can take advantage of the fact that every other sample is zero which would take nearly half the time. I might also look at QMF's now you've got me started, although I think that the delay aspect might get a bit...interesting...

Thanks again.
Dave</description>
		<content:encoded><![CDATA[<p>O.K. just a quick followup. I got this to work, and a single pulse can be reconstructed! The problem was that the descending cascade of FIR filters were creating an ever increasing delay. This needs to be compensated with a large delay for the first (top) band and decreasing through to nothing for the lower bands.<br />
I&#8217;ve got 6 bands with a 12 point (SSE) FIR&#8217;s running at about 15% of my P4 cpu, which isn&#8217;t great, but I can take advantage of the fact that every other sample is zero which would take nearly half the time. I might also look at QMF&#8217;s now you&#8217;ve got me started, although I think that the delay aspect might get a bit&#8230;interesting&#8230;</p>
<p>Thanks again.<br />
Dave</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dave H</title>
		<link>http://hostilefork.com/2007/12/16/perfect-reconstruction-equalizer/#comment-739</link>
		<dc:creator>Dave H</dc:creator>
		<pubDate>Fri, 17 Oct 2008 15:23:19 +0000</pubDate>
		<guid isPermaLink="false">http://hostilefork.com/2007/12/16/perfect-reconstruction-equalizer/#comment-739</guid>
		<description>Thanks for all your help, the code is much appreciated, as the only other Remez (by Jake) appears to have some very serious memory issues.
 I might look at the A'Trous wavelets stuff as well, it all seems a very interesting field, I just hope my brain can take it!  ; )</description>
		<content:encoded><![CDATA[<p>Thanks for all your help, the code is much appreciated, as the only other Remez (by Jake) appears to have some very serious memory issues.<br />
 I might look at the A&#8217;Trous wavelets stuff as well, it all seems a very interesting field, I just hope my brain can take it!  ; )</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Hostile Fork</title>
		<link>http://hostilefork.com/2007/12/16/perfect-reconstruction-equalizer/#comment-727</link>
		<dc:creator>Hostile Fork</dc:creator>
		<pubDate>Thu, 16 Oct 2008 03:11:19 +0000</pubDate>
		<guid isPermaLink="false">http://hostilefork.com/2007/12/16/perfect-reconstruction-equalizer/#comment-727</guid>
		<description>A bandpass approach for E equalization levels would use E filter operations on the original signal length.  This method uses roughly 2+(E-2)*2.  It is more filtering, but not &lt;i&gt;catastrophically more&lt;/i&gt;...and it solves a particular problem that I explained in the article.

I'll restate the motivation: Imagine you make a set of B bandpass filters, and then set the EQ so it's all level (e.g. the weight for each band that you use to sum into the signal is at 1).  Now ask: will running this "null equalization" on an arbitrary signal always give you the original signal back, or will the different characteristics of the filters cause interference and noise to appear?

I'm not aware of a way to design a set of bandpass filters that would not introduce some noise.  Especially when you're trying to capture different frequencies covering logarithmic ranges, and thus possibly using different size filters...!  If you know how to do it, I'd be interested to know.

What I came up with is trickier because it was trying to take the principles of &lt;a href="http://www.mathworks.com/products/filterdesign/demos.html?file=/products/demos/shipping/filterdesign/pr2chfilterbankdemo.html" rel="nofollow"&gt;Perfect Reconstruction&lt;/a&gt; and apply them to a graphic equalizer.  In addition to acting like you'd expect an equalizer to act when you have the weights set at different values, the process of all this turmoil spits out the exact original bytes you put in when the weights are 1!  I believed I'd proven it to work, and my TAs in college did too, so maybe it's for real...but we could have been wrong. :)  

The Remez code I found is by Egil Kvaleberg, ported from Fortran.  I will email it to you.</description>
		<content:encoded><![CDATA[<p>A bandpass approach for E equalization levels would use E filter operations on the original signal length.  This method uses roughly 2+(E-2)*2.  It is more filtering, but not <i>catastrophically more</i>&#8230;and it solves a particular problem that I explained in the article.</p>
<p>I&#8217;ll restate the motivation: Imagine you make a set of B bandpass filters, and then set the EQ so it&#8217;s all level (e.g. the weight for each band that you use to sum into the signal is at 1).  Now ask: will running this &#8220;null equalization&#8221; on an arbitrary signal always give you the original signal back, or will the different characteristics of the filters cause interference and noise to appear?</p>
<p>I&#8217;m not aware of a way to design a set of bandpass filters that would not introduce some noise.  Especially when you&#8217;re trying to capture different frequencies covering logarithmic ranges, and thus possibly using different size filters&#8230;!  If you know how to do it, I&#8217;d be interested to know.</p>
<p>What I came up with is trickier because it was trying to take the principles of <a href="http://www.mathworks.com/products/filterdesign/demos.html?file=/products/demos/shipping/filterdesign/pr2chfilterbankdemo.html" rel="nofollow" target="_blank" class="liexternal">Perfect Reconstruction</a> and apply them to a graphic equalizer.  In addition to acting like you&#8217;d expect an equalizer to act when you have the weights set at different values, the process of all this turmoil spits out the exact original bytes you put in when the weights are 1!  I believed I&#8217;d proven it to work, and my TAs in college did too, so maybe it&#8217;s for real&#8230;but we could have been wrong. <img src='http://hostilefork.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  </p>
<p>The Remez code I found is by Egil Kvaleberg, ported from Fortran.  I will email it to you.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dave H</title>
		<link>http://hostilefork.com/2007/12/16/perfect-reconstruction-equalizer/#comment-723</link>
		<dc:creator>Dave H</dc:creator>
		<pubDate>Wed, 15 Oct 2008 13:41:41 +0000</pubDate>
		<guid isPermaLink="false">http://hostilefork.com/2007/12/16/perfect-reconstruction-equalizer/#comment-723</guid>
		<description>Hello thank-you for the extra information on this, it's much clearer now, especially with the new diagram. There's a lot of filtering going on there, so I was wondering why you couldn't just bandpass filter the original signal at different frequencies. I might look at some wavelet stuff, although I hear that aliasing is an issue, so it could end up very similar to your technique.
I found some C code by Jake Janovetz to do the remez coefficients, it seems to work O.K, but it does crash with certain values, did you use his code?
Thanks again,
Dave H</description>
		<content:encoded><![CDATA[<p>Hello thank-you for the extra information on this, it&#8217;s much clearer now, especially with the new diagram. There&#8217;s a lot of filtering going on there, so I was wondering why you couldn&#8217;t just bandpass filter the original signal at different frequencies. I might look at some wavelet stuff, although I hear that aliasing is an issue, so it could end up very similar to your technique.<br />
I found some C code by Jake Janovetz to do the remez coefficients, it seems to work O.K, but it does crash with certain values, did you use his code?<br />
Thanks again,<br />
Dave H</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Hostile Fork</title>
		<link>http://hostilefork.com/2007/12/16/perfect-reconstruction-equalizer/#comment-720</link>
		<dc:creator>Hostile Fork</dc:creator>
		<pubDate>Tue, 14 Oct 2008 23:22:03 +0000</pubDate>
		<guid isPermaLink="false">http://hostilefork.com/2007/12/16/perfect-reconstruction-equalizer/#comment-720</guid>
		<description>&lt;i&gt;(Note: It's been a long time since I did this.  Er, 12 years ago?  I was an undergraduate electrical engineer, and I haven't done much DSP since.  So I'd be surprised if someone didn't have a better idea of how to do it than what I came up with for a project, or if I was wrong about something!)&lt;/i&gt;

The decreasing of array widths is a conceptual thing...and really the data can all be processed in place.  But to more clearly explicitly show what's happening and what all the bookkeeping needs to do, I tried to "pull it apart".  Here I'll badly hack up the "next step" if you want more than 3 bands in your EQ...and you'll see why I preferred to stop after 2 steps.  :)

&lt;p align="center"&gt;&lt;img src="http://hostilefork.com/wp-content/uploads/2008/10/step3dsp.png" alt="Third Step In Recursive Process" title="step3dsp" class="alignnone size-medium wp-image-93" /&gt;&lt;/a&gt;&lt;/p&gt;

So imagine that if you have a low pass Remez filter that basically passes everything below 2kHz, and you want to pass everything below 1kHz instead.  To get an equivalent to a low pass 1kHz Remez filter, just use the 2kHz design on the even samples, the odd samples, and then interleave them back together in time.  (The idea of taking a 4kHz Remez filter and dropping it to 1kHz by taking every 1st, 2nd, 3rd, and 4th sample... running the process...and then putting the samples back in their sequence post-filtering would be expected if this were true.)

This process is what I'm referring to as a "logarithmic drop".  I almost certainly can't prove myself today that process would give you another perfect reconstruction.  That must have been something I read or learned at the time, because I don't know how I'd have just taken that for granted unless the professor said I could!  Still&#8212;it would be very interesting to me if someone could recreate the effect (or debunk it).  Please let me know how it goes...

(P.S. I found an old C program that generates Remez filter coefficients if you don't have Matlab or something like that available.)</description>
		<content:encoded><![CDATA[<p><i>(Note: It&#8217;s been a long time since I did this.  Er, 12 years ago?  I was an undergraduate electrical engineer, and I haven&#8217;t done much DSP since.  So I&#8217;d be surprised if someone didn&#8217;t have a better idea of how to do it than what I came up with for a project, or if I was wrong about something!)</i></p>
<p>The decreasing of array widths is a conceptual thing&#8230;and really the data can all be processed in place.  But to more clearly explicitly show what&#8217;s happening and what all the bookkeeping needs to do, I tried to &#8220;pull it apart&#8221;.  Here I&#8217;ll badly hack up the &#8220;next step&#8221; if you want more than 3 bands in your EQ&#8230;and you&#8217;ll see why I preferred to stop after 2 steps.  <img src='http://hostilefork.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p align="center"><img src="http://hostilefork.com/wp-content/uploads/2008/10/step3dsp.png" alt="Third Step In Recursive Process" title="step3dsp" class="alignnone size-medium wp-image-93" /></p>
<p>So imagine that if you have a low pass Remez filter that basically passes everything below 2kHz, and you want to pass everything below 1kHz instead.  To get an equivalent to a low pass 1kHz Remez filter, just use the 2kHz design on the even samples, the odd samples, and then interleave them back together in time.  (The idea of taking a 4kHz Remez filter and dropping it to 1kHz by taking every 1st, 2nd, 3rd, and 4th sample&#8230; running the process&#8230;and then putting the samples back in their sequence post-filtering would be expected if this were true.)</p>
<p>This process is what I&#8217;m referring to as a &#8220;logarithmic drop&#8221;.  I almost certainly can&#8217;t prove myself today that process would give you another perfect reconstruction.  That must have been something I read or learned at the time, because I don&#8217;t know how I&#8217;d have just taken that for granted unless the professor said I could!  Still&mdash;it would be very interesting to me if someone could recreate the effect (or debunk it).  Please let me know how it goes&#8230;</p>
<p>(P.S. I found an old C program that generates Remez filter coefficients if you don&#8217;t have Matlab or something like that available.)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dave H</title>
		<link>http://hostilefork.com/2007/12/16/perfect-reconstruction-equalizer/#comment-719</link>
		<dc:creator>Dave H</dc:creator>
		<pubDate>Tue, 14 Oct 2008 21:57:27 +0000</pubDate>
		<guid isPermaLink="false">http://hostilefork.com/2007/12/16/perfect-reconstruction-equalizer/#comment-719</guid>
		<description>Hi, thanks for replying quickly. I took your statement "..logarithmic decrease of the array widths.." to be like a discrete wavelet type of algorithm structure. For a second iteration you will need to halve the filter values because it's the same length of data, is that correct? If that was the case then why not simply put it through successive filters without the interleave stuff.
I think probably having a dumb-arse day(!), I guess I'm just not getting it.</description>
		<content:encoded><![CDATA[<p>Hi, thanks for replying quickly. I took your statement &#8220;..logarithmic decrease of the array widths..&#8221; to be like a discrete wavelet type of algorithm structure. For a second iteration you will need to halve the filter values because it&#8217;s the same length of data, is that correct? If that was the case then why not simply put it through successive filters without the interleave stuff.<br />
I think probably having a dumb-arse day(!), I guess I&#8217;m just not getting it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Hostile Fork</title>
		<link>http://hostilefork.com/2007/12/16/perfect-reconstruction-equalizer/#comment-718</link>
		<dc:creator>Hostile Fork</dc:creator>
		<pubDate>Tue, 14 Oct 2008 19:39:29 +0000</pubDate>
		<guid isPermaLink="false">http://hostilefork.com/2007/12/16/perfect-reconstruction-equalizer/#comment-718</guid>
		<description>Hello Dave,

Would be interesting to have someone reproduce it!  I actually had coded this for a Texas Instruments DSP chip.  Lost the source code but still had the writeup and diagrams, so I figured...well, might as well post them...

Not sure I understand your question, but I'll try and answer.  (Note that this algorithm isn't suitable for processing real-time data; you must know how long your input signal is...let's call that length L).
  
This is a recursive process.  Each time you apply "the process" you will get two signals of length L.  One of those is the time-domain representation of a higher pass band which you're done filtering.  It's suitable for weighting and adding together to get a band in the overall signal.  The other you have a choice: (1) you can take it as it is as a band in its own right, or (2) you can run the algorithm again on it to get another two signals of length L.

So if you refer to the "Implementation Diagram", it does two steps on your data to produce two completed series of length L (the black ones: labeled band 1 and band 2).  Then after the second step you've got a band on the left that you may choose to run the process on again, or consider yourself done and use it as band 3.

Make sense?  Each time you get a completed band it needs to be the same size as the original.  Then you multiply the samples in that signal by your EQ setting for that band, and add them all up.  

If you write a modern reference implementation I'd appreciate you sharing your findings or tools used.  I looked into tweaking Audacity to use the method but it looked like more of a project than I wanted at the time...</description>
		<content:encoded><![CDATA[<p>Hello Dave,</p>
<p>Would be interesting to have someone reproduce it!  I actually had coded this for a Texas Instruments DSP chip.  Lost the source code but still had the writeup and diagrams, so I figured&#8230;well, might as well post them&#8230;</p>
<p>Not sure I understand your question, but I&#8217;ll try and answer.  (Note that this algorithm isn&#8217;t suitable for processing real-time data; you must know how long your input signal is&#8230;let&#8217;s call that length L).</p>
<p>This is a recursive process.  Each time you apply &#8220;the process&#8221; you will get two signals of length L.  One of those is the time-domain representation of a higher pass band which you&#8217;re done filtering.  It&#8217;s suitable for weighting and adding together to get a band in the overall signal.  The other you have a choice: (1) you can take it as it is as a band in its own right, or (2) you can run the algorithm again on it to get another two signals of length L.</p>
<p>So if you refer to the &#8220;Implementation Diagram&#8221;, it does two steps on your data to produce two completed series of length L (the black ones: labeled band 1 and band 2).  Then after the second step you&#8217;ve got a band on the left that you may choose to run the process on again, or consider yourself done and use it as band 3.</p>
<p>Make sense?  Each time you get a completed band it needs to be the same size as the original.  Then you multiply the samples in that signal by your EQ setting for that band, and add them all up.  </p>
<p>If you write a modern reference implementation I&#8217;d appreciate you sharing your findings or tools used.  I looked into tweaking Audacity to use the method but it looked like more of a project than I wanted at the time&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dave H</title>
		<link>http://hostilefork.com/2007/12/16/perfect-reconstruction-equalizer/#comment-716</link>
		<dc:creator>Dave H</dc:creator>
		<pubDate>Tue, 14 Oct 2008 16:02:14 +0000</pubDate>
		<guid isPermaLink="false">http://hostilefork.com/2007/12/16/perfect-reconstruction-equalizer/#comment-716</guid>
		<description>Hello, I'm trying to reproduce your nicely explained EQ. I'm a little confused about your arrowed diagram showing two bands. Basically you state that it's efficient because of the down-sampling and halving of data. But the diagram shows the lower side interleaved and the same size as the original. Can you explain at which point the next band is created from please?
Cheers,
D</description>
		<content:encoded><![CDATA[<p>Hello, I&#8217;m trying to reproduce your nicely explained EQ. I&#8217;m a little confused about your arrowed diagram showing two bands. Basically you state that it&#8217;s efficient because of the down-sampling and halving of data. But the diagram shows the lower side interleaved and the same size as the original. Can you explain at which point the next band is created from please?<br />
Cheers,<br />
D</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eric</title>
		<link>http://hostilefork.com/2007/12/16/perfect-reconstruction-equalizer/#comment-53</link>
		<dc:creator>Eric</dc:creator>
		<pubDate>Mon, 17 Dec 2007 03:51:34 +0000</pubDate>
		<guid isPermaLink="false">http://hostilefork.com/2007/12/16/perfect-reconstruction-equalizer/#comment-53</guid>
		<description>Why is it that, thinking about wave mechanics always leads me to go just a little bit more mad?

I still remember when my 6th-grade science teacher told us that the Sun emitted light at all frequencies equally (which theoretically requires infinite energy).  I think that's when I popped. Now I'm more careful in questioning Dirac's constant. 

My undestanding, last I looked at these issues, was that the more accurate a frequency manipulation you desired, the more latency needed to be introduced, the bane of live performance, and the irritant of synchronized-sound applications (A/V players).

I also understand that almost all software frequency analyzers and most hardware ones use various methods to cheat to make their tasks easier, figuring that no one will ever notice their lack of frequency response fidelity.</description>
		<content:encoded><![CDATA[<p>Why is it that, thinking about wave mechanics always leads me to go just a little bit more mad?</p>
<p>I still remember when my 6th-grade science teacher told us that the Sun emitted light at all frequencies equally (which theoretically requires infinite energy).  I think that&#8217;s when I popped. Now I&#8217;m more careful in questioning Dirac&#8217;s constant. </p>
<p>My undestanding, last I looked at these issues, was that the more accurate a frequency manipulation you desired, the more latency needed to be introduced, the bane of live performance, and the irritant of synchronized-sound applications (A/V players).</p>
<p>I also understand that almost all software frequency analyzers and most hardware ones use various methods to cheat to make their tasks easier, figuring that no one will ever notice their lack of frequency response fidelity.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
