English Amiga Board


Go Back   English Amiga Board > Coders > Coders. General

 
 
Thread Tools
Old 16 August 2012, 08:34   #21
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,506
Quote:
Originally Posted by Thorham View Post
Really? Well, that sucks then, because I've been telling people the thing is 14 bit Perhaps I'll write a program to test this just for fun
I don't think it is possible to test this using only software.

Quote:
Seems odd considering Paula can handle sample rates of over a megabyte per second (or is that also untrue?).
Digital part of Paula can handle it but I am quite sure DAC isn't fast enough.
Toni Wilen is offline  
Old 16 August 2012, 11:02   #22
hooverphonique
ex. demoscener "Bigmama"
 
Join Date: Jun 2012
Location: Fyn / Denmark
Posts: 1,624
under normal circumstances, the highest number of samples per second possible is 28867. This means (according to Nyquist criteria) that the highest frequency sound you can play correctly is 28867/2 = 14434.

If the volume pwm counters run at a frequency of 56KHz and you want to use volume levels other than 64, this also limits the samplerate to ~28KHz (56/2) or you would get aliasing.

Considering this volume implementation, the hardware designers would be stupid to use anything but 8-bit DACs..

Last edited by hooverphonique; 16 August 2012 at 16:35.
hooverphonique is offline  
Old 16 August 2012, 14:24   #23
Thorham
Computer Nerd
 
Thorham's Avatar
 
Join Date: Sep 2007
Location: Rotterdam/Netherlands
Age: 47
Posts: 3,752
Quote:
Originally Posted by Toni Wilen View Post
I don't think it is possible to test this using only software.
It can and is in fact simple enough. You'll need to program the audio using the CPU only, so you'll need an interupt-less environment. You then play a sample that's made up of only 127s. Next, you feed your test sample through the volume part. All you have to do is make sure you have a high sample rate sample. If Paula is 14 bit, then your sample should sound quite reasonable, if not, it should sound like absolute crap... or that's the idea.

Quote:
Originally Posted by Toni Wilen View Post
Digital part of Paula can handle it but I am quite sure DAC isn't fast enough.
It can still handle at least 84 Khz (Megalo Sound sampler and it's software allow this). Should be good enough for testing the above.

Quote:
Originally Posted by hooverphonique View Post
If the volume pwm counters run at a frequency of 56KHz and you want to use volume levels other than 64, this also limits the samplerate to ~28KHz (56/2) or you would get aliasing.
If that's true, then why does 44 Khz 14 bit sound so good on double scanrate? I use a VGA dongle on my A1200 so I can use 31 Khz displays, and playing anything that's CD quality, sounds very good. According to what you're saying, it shouldn't, or am I misinterpreting what you're saying (could be )?
Thorham is offline  
Old 16 August 2012, 16:48   #24
hooverphonique
ex. demoscener "Bigmama"
 
Join Date: Jun 2012
Location: Fyn / Denmark
Posts: 1,624
Quote:
Originally Posted by Thorham View Post
If that's true, then why does 44 Khz 14 bit sound so good on double scanrate? I use a VGA dongle on my A1200 so I can use 31 Khz displays, and playing anything that's CD quality, sounds very good. According to what you're saying, it shouldn't, or am I misinterpreting what you're saying (could be )?
Well, my previous statement might be wrong - it depends on if the 56KHz refers to counting from 0-64 or to count +1. If it's the latter, the chopping is so slow, that no aliasing effect would occur for high frequency content (it might for low frequency stuff, though).

When running in double scan, paula is able to play back higher samplerates using dma. If this also affects frequency of the volume counters, I don't know.
hooverphonique is offline  
Old 16 August 2012, 17:33   #25
mc6809e
Registered User
 
Join Date: Jan 2012
Location: USA
Posts: 372
Quote:
Originally Posted by hooverphonique View Post
under normal circumstances, the highest number of samples per second possible is 28867. This means (according to Nyquist criteria) that the highest frequency sound you can play correctly is 28867/2 = 14434.
That is a misapplication of the Nyquist criteria.

The Amiga outputs samples. That is subtly different from sampling. One isn't necessarily trying to reconstruct a waveform. One instead tries to synthesize a waveform from a table of values (the Amiga hardware even supports wavetable synthesis by allowing one channel to modulate another's pitch or volume).

A two sample square wave output at 1000 samples per second, for example, will generate an infinite number of odd integer harmonics above 1000Hz -- 3000Hz, 5000Hz, or 17000Hz, or 19000Hz, etc.

Whether or not those frequencies are output depends on the details of the Amiga's output filter and not the sample rate.
mc6809e is offline  
Old 16 August 2012, 19:47   #26
hooverphonique
ex. demoscener "Bigmama"
 
Join Date: Jun 2012
Location: Fyn / Denmark
Posts: 1,624
Yes and no.. It might be misapplication of Nyquist, I don't remember anymore, but it still holds true. How would you play back a wave of frequency 20KHz, for instance, if your max sample rate is 28KHz? By playing a lower frequency wave and then rely on harmonics? The smallest wave you can do contains 2 samples, so you cannot really create a direct wave of higher frequency than half the max sample rate..
hooverphonique is offline  
Old 16 August 2012, 20:41   #27
mc6809e
Registered User
 
Join Date: Jan 2012
Location: USA
Posts: 372
Quote:
Originally Posted by hooverphonique View Post
Yes and no.. It might be misapplication of Nyquist, I don't remember anymore, but it still holds true. How would you play back a wave of frequency 20KHz, for instance, if your max sample rate is 28KHz? By playing a lower frequency wave and then rely on harmonics? The smallest wave you can do contains 2 samples, so you cannot really create a direct wave of higher frequency than half the max sample rate..
I think what you mean to write is that it isn't possible to produce a single sinusoid of 20KHz without also producing waves of other frequencies.

Okay. But I have to disagree with your suggestion that somehow harmonics aren't real frequencies that are output along with the fundamental.

The question was whether or not the Amiga can produce frequencies above 14KHz using DMA and no tricks. The answer is "yes".

The confusion comes from seeing the Amiga's audio strictly as a kind of sampler. It isn't just a sampler. It outputs arbitrary waveforms at variable rates up to 14K values per second per voice. It's a synthesizer. And synthesizers have a long history of relying on the higher-order harmonics of basic waveforms to develop sounds with a complex timbre. A single pure sinusoid of 20KHz is mostly useless. A lower frequency square wave and all it's harmonics, on the other hand, is very useful.

Where the Amiga's audio suffers is in the control of high frequency random noise above 14KHz.
mc6809e is offline  
Old 19 August 2012, 22:53   #28
absence
Registered User
 
Join Date: Mar 2009
Location: moon
Posts: 373
Wow, this thread went out of hand rather quickly and prooves audio is a little understood topic in the community...
absence is offline  
Old 20 August 2012, 13:37   #29
Don_Adan
Registered User
 
Join Date: Jan 2008
Location: Warsaw/Poland
Age: 55
Posts: 1,960
Quote:
Originally Posted by hooverphonique View Post
If you use a byte write, I guess you have to write to $dff0a9 to set bits 6-0, but you're saying that on a 68000, performing "move.b #$40, $dff0a8" will actually be the same as performing "move.w #$4040, $dff0a8" ???
Yes, it works as move.w #$4040, $dff0a8.
If you have A500 and Action Replay 3, you can trace Amiga registers, easy enough.
Don_Adan is offline  
Old 20 August 2012, 13:42   #30
Don_Adan
Registered User
 
Join Date: Jan 2008
Location: Warsaw/Poland
Age: 55
Posts: 1,960
Quote:
Originally Posted by hooverphonique View Post
under normal circumstances, the highest number of samples per second possible is 28867. This means (according to Nyquist criteria) that the highest frequency sound you can play correctly is 28867/2 = 14434.

If the volume pwm counters run at a frequency of 56KHz and you want to use volume levels other than 64, this also limits the samplerate to ~28KHz (56/2) or you would get aliasing.

Considering this volume implementation, the hardware designers would be stupid to use anything but 8-bit DACs..
Again this is no true (or not full true), 28867 limit is only for 4th Amiga channel, every Amiga channel has own limit. Maximum value is 29313 for first channel.
Don_Adan is offline  
Old 20 August 2012, 20:54   #31
mc6809e
Registered User
 
Join Date: Jan 2012
Location: USA
Posts: 372
Quote:
Originally Posted by Don_Adan View Post
Again this is no true (or not full true), 28867 limit is only for 4th Amiga channel, every Amiga channel has own limit. Maximum value is 29313 for first channel.
Interesting.

Does that mean the allocation of the audio DMA channels per voice is not fixed?
mc6809e is offline  
Old 20 August 2012, 21:26   #32
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,506
Quote:
Originally Posted by mc6809e View Post
Interesting.

Does that mean the allocation of the audio DMA channels per voice is not fixed?
http://eab.abime.net/showthread.php?p=677012#post677012
Toni Wilen is offline  
Old 15 September 2012, 11:59   #33
Thcm
Registered User
 
Join Date: Dec 2011
Location: Gummersbach
Posts: 18
What happens if a Protracker module uses a lower period than 124? I'm currently working on a Protracker replayer for the c64 and I found a lot Amiga modules using lower periods.
Thcm is offline  
Old 15 September 2012, 12:49   #34
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,506
Quote:
Originally Posted by Thcm View Post
What happens if a Protracker module uses a lower period than 124? I'm currently working on a Protracker replayer for the c64 and I found a lot Amiga modules using lower periods.
Sample word (=2x8-bit samples) keep repeating until new sample arrives.
Toni Wilen is offline  
Old 16 October 2012, 20:20   #35
Photon
Moderator
 
Photon's Avatar
 
Join Date: Nov 2004
Location: Eksjö / Sweden
Posts: 5,602
Quote:
Originally Posted by Don_Adan View Post
Again this is no true (or not full true), 28867 limit is only for 4th Amiga channel, every Amiga channel has own limit. Maximum value is 29313 for first channel.
Quote:
Originally Posted by mc6809e View Post
Interesting.

Does that mean the allocation of the audio DMA channels per voice is not fixed?
Not practically, though. You would want to set a common software limit and let a sample be played in any channel and not be channel locked.

Quote:
Originally Posted by Thcm View Post
What happens if a Protracker module uses a lower period than 124?
It will sound shrill and rasping, for high-frequency instruments rather like the whistle of a referee. In other words, like crap. You can test this by starting Protracker, load a melody instrument, and then press U (or 0, depending on how high that version goes).
Photon is offline  
Old 18 October 2012, 13:57   #36
pandy71
Registered User
 
Join Date: Jun 2010
Location: PL?
Posts: 2,747
Quote:
Originally Posted by mc6809e View Post
The PWM frequency is 56KHz. This would seem to imply an upper limit of 56K samples per second. The volume counters are reset whenever a new sample is loaded for output, however, so as the output rate increases above 56K, the number of available volume levels effectively goes down but the output rate can continue to increase.
Oh - I think that PWM clock is 3.58MHz - and probably similar architecture as C-64 SID was used in Paula - 8 bit DAC provide Vref for PWM.

This should be quite easy to check - set two samples identical value (AUDxDAT) then modulate PWM (AUDxVOL) even square wave (but fast - maybe with Copper help), scope connected to audio output before integrator (directly to Paula pin) should show real frequency for PWM - 56kHz seems to be very low clock and IMHO will create lot intermodulation distortions.

Limit 56kHz is related only to DMA not software driven audio (even HRM mention about 1.79MHz PWM audio)
pandy71 is offline  
Old 18 October 2012, 14:04   #37
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,506
Quote:
Originally Posted by pandy71 View Post
Oh - I think that PWM clock is 3.58MHz - and probably similar architecture as C-64 SID was used in Paula - 8 bit DAC provide Vref for PWM.
It is 3.58MHz. ~56KHz * 64 (volume counter size) = 3.58MHz.
Toni Wilen is offline  
Old 18 October 2012, 14:05   #38
pandy71
Registered User
 
Join Date: Jun 2010
Location: PL?
Posts: 2,747
Quote:
Originally Posted by Thorham View Post
Really? Well, that sucks then, because I've been telling people the thing is 14 bit Perhaps I'll write a program to test this just for fun
Seems odd considering Paula can handle sample rates of over a megabyte per second (or is that also untrue?).
Paula probably have 4x 8 bit DAC's and 4x 6 bit PWM attenuators - similar solution is used in SID from C-64 - this also can explain why there is 7 bit used to control PWM level (bypas PWM) - period time in PWM is divided from 0 to 63/64 ie to have full level for PWM=64 they need to bypass PWM which create in real life 65 values


Quote:
Originally Posted by Toni Wilen View Post
It is 3.58MHz. ~56KHz * 64 (volume counter size) = 3.58MHz.
So sampling frequency for PWM is 3.58MHz/64 samples per second - ie if someone decide instead using 8 bit DAC to produce audio, 6 bit PWM as DAC can't expect sampling frequency higher than this (Nyquist criteria). To avoid problems with higher DMA audio sampling frequencies - value 65 (ie bypas PWM ) for AUDxVOL must be used - perhaps someone can verify this on ECS or AGA (create video mode when H frequency will be much faster than VGA ie something like 60kHz - this probably imply video mode with 80 pixels for lowres)

Last edited by prowler; 18 October 2012 at 22:41. Reason: Back-to-back posts merged.
pandy71 is offline  
Old 18 October 2012, 15:09   #39
absence
Registered User
 
Join Date: Mar 2009
Location: moon
Posts: 373
Quote:
Originally Posted by pandy71 View Post
Paula probably have 4x 8 bit DAC's and 4x 6 bit PWM attenuators - similar solution is used in SID from C-64 - this also can explain why there is 7 bit used to control PWM level (bypas PWM) - period time in PWM is divided from 0 to 63/64 ie to have full level for PWM=64 they need to bypass PWM which create in real life 65 values
Correct, that's what Toni's measurements confirmed.

Quote:
Originally Posted by pandy71 View Post
So sampling frequency for PWM is 3.58MHz/64 samples per second - ie if someone decide instead using 8 bit DAC to produce audio, 6 bit PWM as DAC can't expect sampling frequency higher than this (Nyquist criteria).
With all respect it sounds like you're confusing the Nyquist theorem with amplitude modulation.

Quote:
Originally Posted by pandy71 View Post
To avoid problems with higher DMA audio sampling frequencies - value 65 (ie bypas PWM ) for AUDxVOL must be used - perhaps someone can verify this on ECS or AGA (create video mode when H frequency will be much faster than VGA ie something like 60kHz - this probably imply video mode with 80 pixels for lowres)
I don't think there's anything special about the Paulas used in ECS or AGA, so there's nothing to verify. Faster DMA doesn't affect the modulation.

Last edited by prowler; 18 October 2012 at 22:43. Reason: Fixed quotes.
absence is offline  
Old 18 October 2012, 20:41   #40
pandy71
Registered User
 
Join Date: Jun 2010
Location: PL?
Posts: 2,747
Quote:
Originally Posted by absence View Post
Correct, that's what Toni's measurements confirmed.
Yep - never claimed anything else.

Quote:
Originally Posted by absence View Post
With all respect it sounds like you're confusing the Nyquist theorem with amplitude modulation.
Why?
This is circuit with two DAC's in series and one of them can be bypassed.

To add more details - max frequency that can be reproduced by PWM DAC in Amiga is half 3.58MHz/64.

Quote:
Originally Posted by absence View Post
I don't think there's anything special about the Paulas used in ECS or AGA, so there's nothing to verify. Faster DMA doesn't affect the modulation.
Yes, and i never claimed that there is ECS or AGA Paula - verification in ECS or AGA system can be easier due fact that video sequencer is programmable and H line can be shorter thus H frequency higher and DMA data can be feed to Paula faster than 56ksps - then verification for internal architecture should be easier (however i think that at least in theory H line can be shortened also on OCS by access cycle to correct STR* strobe registers). And faster DMA can affect modulation when modulation one channel to another is active - (however only one byte from word is used) - limitations for internal Paula architecture can be easily exposed when H line will be really short.

Last edited by pandy71; 18 October 2012 at 20:49.
pandy71 is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
USB Flash Disk Low-Level Format prowler support.Hardware 53 03 August 2012 21:39
Low level format utility for the A1200 Fabie support.Hardware 20 11 January 2010 19:13
I'm stuck on the final level (level 3) of Ghostbusters II. Ironclaw support.Games 34 24 October 2007 07:19
When to low level format Galaxy support.Hardware 6 30 January 2007 12:39
Low Level Format??? Djay support.Hardware 4 01 March 2003 20:58

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

Forum Jump


All times are GMT +2. The time now is 03:25.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.17247 seconds with 14 queries