Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.sys.apple2.programmer > #4517

Re: WAV file playback

Newsgroups comp.sys.apple2.programmer
Subject Re: WAV file playback
From Michael J. Mahon <mjmahon@aol.com>
References <3940d945-abbb-4cc8-9057-67b37c879c01@googlegroups.com> <a83efba1-a341-4589-bd91-2617663f835f@googlegroups.com> <Uf-dncBDSKQrrEHHnZ2dnUU7-fPNnZ2d@giganews.com> <f508cf75-e357-4906-8fc7-2c710fa15e86@googlegroups.com>
Message-ID <Y_2dnT-ImMMqiEPHnZ2dnUU7-RVQAAAA@giganews.com> (permalink)
Date 2018-04-23 12:19 -0500

Show all headers | View raw


Michael Pohoreski <michael.pohoreski@gmail.com> wrote:
> On Saturday, April 21, 2018 at 11:54:51 PM UTC-7, mjm...@aol.com wrote:
>> Michael Pohoreski wrote:
>>> 11,025 Hz requires = 17,030 * 29.97 / 11,025 = 46.293 cycles between speaker toggling.
>>> 
>> I think the OP’s meaning was that at a sample rate of 11.025 KHz, each
>> sample must be played in (ideally) 92.5 Apple II cycles. 
> 
> Right. I just wanted to clarify that a "sample" means two speaker toggles
> since it wasn't explicitly clear. =P

Right. 

>> Of course, only integral numbers of cycles are possible, and the sample
>> rate cannot alternate between 92 and 93 cycles, since the jitter would
>> introduce spurious frequencies surrounding 5.5125 KHz. 
> 
> I'm assuming this related to following calculations?
> 
> 92 cycles = 5547.707609 Hz
> 93 cycles = 5488.054839 Hz

Simpler—see my other reply. 

>> The best non-distorting choice is then 92 cycles per sample.
> 
> Interesting. How did you determine that?

It’s just the closest even number, and I prefer even numbers because I
prefer double pulse rates. ;-)

>> I found this convenient in DAC522, since 92 is an even number, 
>> and I wanted to generate
>> two speaker pulses (four toggles) for each sample. 
> 
> What was the duty cycle you used for 4 pulses?

I generate 32 distinct pulse widths, determined by the 5 most significant
bits of the sample. The pulse widths vary from 6 to 37 cycles with a
46-cycle period. (DAC522 refers to 5 significant bits and a 22 KHz pulse
rate.)

>> This raises the pulse
>> frequency to 22.05 KHz, which is less annoying to most people “of an age”
> 
> I must be getting old, because I can't hear anything past ~14 KHz ... :-/

Age will do that for most people—well, age and loud music. ;-)  I’m
currently about 30 dB down at 3.5 KHz...

>> (In the absence of “brick wall” filters, the practical top frequency is
>> closer to 5 KHz.)
> 
> How did you determine that?

The “reconstruction filter” following a D-to-A converter must provide a lot
of attenuation at and above the Nyquist frequency of about 5.5 KHz, and
since very sharp (brick wall) filters are not practical, there’s usually a
rolloff before 5 KHz.

> Cheers
> Michael
> 



-- 
-michael - NadaNet 3.1 and AppleCrate II:  http://michaeljmahon.com

Back to comp.sys.apple2.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

WAV file playback "Frank M." <frank_o_rama@hotmail.com> - 2018-03-19 12:15 -0700
  Re: WAV file playback Chris Vavruska <vavruska@gmail.com> - 2018-03-19 18:28 -0700
    Re: WAV file playback "Frank M." <frank_o_rama@hotmail.com> - 2018-03-19 19:43 -0700
      Re: WAV file playback Michael J. Mahon <mjmahon@aol.com> - 2018-03-20 01:55 -0500
        Re: WAV file playback "Frank M." <frank_o_rama@hotmail.com> - 2018-03-20 14:49 -0700
          Re: WAV file playback Michael J. Mahon <mjmahon@aol.com> - 2018-03-21 00:23 -0500
            Re: WAV file playback Tom Porter <laseractiveguy@gmail.com> - 2018-03-21 07:36 -0700
              Re: WAV file playback Michael J. Mahon <mjmahon@aol.com> - 2018-03-21 10:13 -0500
                Re: WAV file playback "Frank M." <frank_o_rama@hotmail.com> - 2018-03-22 22:27 -0700
                Re: WAV file playback James Davis <JPD.Enterprises@outlook.com> - 2018-03-24 12:35 -0700
                Re: WAV file playback "Frank M." <frank_o_rama@hotmail.com> - 2018-03-24 19:44 -0700
                Re: WAV file playback James Davis <JPD.Enterprises@outlook.com> - 2018-03-25 09:22 -0700
                Re: WAV file playback "Frank M." <frank_o_rama@hotmail.com> - 2018-03-25 10:08 -0700
  Re: WAV file playback Tom Porter <laseractiveguy@gmail.com> - 2018-03-24 06:05 -0700
    Re: WAV file playback "Frank M." <frank_o_rama@hotmail.com> - 2018-03-24 11:50 -0700
      Re: WAV file playback Michael J. Mahon <mjmahon@aol.com> - 2018-03-24 20:18 -0500
        Re: WAV file playback "Frank M." <frank_o_rama@hotmail.com> - 2018-03-24 19:29 -0700
          Re: WAV file playback Michael J. Mahon <mjmahon@aol.com> - 2018-03-24 21:53 -0500
            Re: WAV file playback "Frank M." <frank_o_rama@hotmail.com> - 2018-03-24 21:49 -0700
              Re: WAV file playback "Frank M." <frank_o_rama@hotmail.com> - 2018-03-24 22:25 -0700
                Re: WAV file playback Michael J. Mahon <mjmahon@aol.com> - 2018-03-25 09:44 -0500
          Re: WAV file playback Michael J. Mahon <mjmahon@aol.com> - 2018-03-24 22:43 -0500
            Re: WAV file playback "Frank M." <frank_o_rama@hotmail.com> - 2018-03-24 21:43 -0700
              Re: WAV file playback Michael J. Mahon <mjmahon@aol.com> - 2018-03-25 09:42 -0500
    Re: WAV file playback "Frank M." <frank_o_rama@hotmail.com> - 2018-03-24 11:56 -0700
  WAV file playback Michael Pohoreski <michael.pohoreski@gmail.com> - 2018-04-21 21:01 -0700
    Re: WAV file playback Michael J. Mahon <mjmahon@aol.com> - 2018-04-22 01:54 -0500
      Re: WAV file playback Michael Pohoreski <michael.pohoreski@gmail.com> - 2018-04-22 22:33 -0700
        Re: WAV file playback Michael J. Mahon <mjmahon@aol.com> - 2018-04-23 12:19 -0500
      Re: WAV file playback Michael Pohoreski <michael.pohoreski@gmail.com> - 2018-04-22 22:53 -0700
        Re: WAV file playback "Frank M." <frank_o_rama@hotmail.com> - 2018-04-23 08:42 -0700
        Re: WAV file playback Michael J. Mahon <mjmahon@aol.com> - 2018-04-23 12:19 -0500
          Re: WAV file playback Michael Pohoreski <michael.pohoreski@gmail.com> - 2018-04-23 22:38 -0700

csiph-web