A simple-to-use sound file writer

Steve Holden steve at holdenweb.com
Fri Jan 15 04:52:03 CET 2010

Alf P. Steinbach wrote:
> * Lie Ryan:
>> On 01/15/10 05:42, Alf P. Steinbach wrote:
>>> I'm beginning to believe that you maybe didn't grok that simple
>>> procedure.
>>> It's very very very trivial, so maybe you were looking for something
>>> more intricate  --  they used to say, in the old days, "hold on, this
>>> proof goes by so fast you may not notice it!"
>> Since you said it's trivial, then...
> You can't get it more trivial.
>>>> Nothing about you there. Just the information you are promoting. I
>>>> don't
>>>> normally deal in innuendo and personal attacks. Though I do
>>>> occasionally
>>>> get irritated by what I perceive to be hogwash. People who know me will
>>>> tell you, if I am wrong I will happily admit it.
>>> There's a difference between an algorithm that you can implement, and
>>> hogwash.
>> please prove your claim by writing that algorithm in code and post it in
>> this list. The program must accept a .wav file (or sound format of your
>> choice) and process it according to your algorithm and the output
>> another .wav file (or sound format of your choice) that sounds roughly
>> similar to the input file.
> First, the (very very trivial) algorithm I posted does *not* do that: by
> itself it represents a sine wave, not an arbitrary wave form.
> And second I'm not about to write Fourier transform code to satisfy
> someone who refuses to do a milligram of thinking.
> The Fourier part stuff needed to do what you're requesting is
> non-trivial, or at least it's some work to write the code.
>> PS: I have near-zero experience with sound processing
>> PPS: I will be equally delighted seeing either Steve admitting his wrong
>> or you admit your hogwash
>> PPPS: An alternative way to convince us is to provide a paper/article
>> that describes this algorithm.
>> PPPPS: Though I will be quite sad if you choose to reject the challenge
> I don't believe any of what you write here.
Well, it seems quite reasonable to me, but then I'm not the one being
challenged to write a trivial algorithm.

I will, however, observe that your definition of a square wave is what I
would have to call a "'square' wave" (and would prefer to call a "pulse
train"), as I envisage a square wave as a waveform having a 50% duty
cycle, as in

 ___     ___
|   |   |   |
|   |   |   |
|   |   |   |
+---+---+---+---+ and so on ad infinitum, (though I might allow you
    |   |   |   |                          to adjust the position
    |   |   |   |                          of y=0 if you want)
    |___|   |___|

as opposed to your

        | |
        | |
  ______| |______   ______
                 | |
                 | |

So I can see how we might be at cross purposes. I could cite authorities
for differentiating between a square wave and a symmetric pulse train,
but will content myself with observing only that my impression is the
common definition of an ideal square wave (one with a zero transition
time) admits of only two instantaneous values, eschewing the zero you
use. If that is the case, we could perhaps agree that we differ merely
on terminology.

Or, best of all, you could show me how to synthesize any waveform by
adding square waves with a 50% duty cycle.  Then I *will* be impressed.

not-wriggling-real-ly y'rs -  steve
Steve Holden           +1 571 484 6266   +1 800 494 3119
PyCon is coming! Atlanta, Feb 2010  http://us.pycon.org/
Holden Web LLC                 http://www.holdenweb.com/
UPCOMING EVENTS:        http://holdenweb.eventbrite.com/

More information about the Python-list mailing list