English Amiga Board


Go Back   English Amiga Board > Support > support.Hardware > Hardware mods

 
 
Thread Tools
Old 27 September 2022, 21:56   #181
Gorf
Registered User
 
Gorf's Avatar
 
Join Date: May 2017
Location: Munich/Bavaria
Posts: 2,426
Quote:
Originally Posted by pandy71 View Post
https://siliconpr0n.org/map/csg/8364r4/mz_mit20x/

Real DAC's in IC's usually not use resistors but instead current sources/mirrors made from scaled (binary weighted) transistors (generally where is possible transistors are used in IC's to replace resistors) and such structures are visible on pictures - there are 4 regular, identical blocks where at each of them (first start at -52nm, -712nm end 3.228u, -120nm , then there are 3 copies bellow) "analog" structure is visible with variable area transistors (IMHO - of course i can be wrong but seem this is obvious, also some bits seem to be same - this could explain some lower linearity) - however strangely there is only 7 distinct "bits" there so or the Paula DAC is only 7 bit or LSB is so small that it use different approach (it may be not different than other transistors).
So you are talking about these?



you are probably right
Attached Thumbnails
Click image for larger version

Name:	Bildschirmfoto 2022-09-27 um 21.34.50.jpg
Views:	416
Size:	199.9 KB
ID:	76687  
Gorf is offline  
Old 27 September 2022, 22:15   #182
nonarkitten
Registered User
 
nonarkitten's Avatar
 
Join Date: Jun 2018
Location: Calgary/Canada
Posts: 247
Let it be said here and forever more that Paula has a 7-bit "real" DAC that can source or sink (giving it sort-of 8-bits) but that has not-so-great linearity and an asymmetrical shape on the positive and negative side. This is then "chopped" with a 55kHz PWM based on a 6-bit volume before being mixed.

I'm going to go out on a limb and say based on this supposed layout of Paula that the volume PWM drives the OpAmp mode into high-z when the volume is off.

I guess the channel-mix is the only "undiscovered country" here.
nonarkitten is offline  
Old 27 September 2022, 22:25   #183
pandy71
Registered User
 
Join Date: Jun 2010
Location: PL?
Posts: 2,885
Quote:
Originally Posted by nonarkitten View Post
Who's claiming 16-bit resolution. Honestly, I'm starting to question if the Amiga really has 8-bit. Thanks Thomas.
Well, 14 bit resolution as sample value 1 can be in one of the 64 (65) levels.

I use two 8 bit PWM as example that PDM need some time (or particular number of samples) to represent unique quantization step PCM as pulse density modulation need many samples averaged over time.

PWM or PDM are similar in such fashion - both need some time i.e. multiple samples where PCM need single sample. And from this perspective PDM is form of temporal dithering.
pandy71 is offline  
Old 27 September 2022, 22:27   #184
pandy71
Registered User
 
Join Date: Jun 2010
Location: PL?
Posts: 2,885
Quote:
Originally Posted by Gorf View Post
So you are talking about these?



you are probably right
Yes, those structures are different than overall chip layout, there is seven such structures in four blocks. It seem that audio occupy more than 60% of Paula die.
pandy71 is offline  
Old 27 September 2022, 22:33   #185
nonarkitten
Registered User
 
nonarkitten's Avatar
 
Join Date: Jun 2018
Location: Calgary/Canada
Posts: 247
Quote:
Originally Posted by pandy71 View Post
Yes, those structures are different than overall chip layout, there is seven such structures in four blocks. It seem that audio occupy more than 60% of Paula die.
Rough block out?
nonarkitten is offline  
Old 27 September 2022, 22:34   #186
pandy71
Registered User
 
Join Date: Jun 2010
Location: PL?
Posts: 2,885
Quote:
Originally Posted by nonarkitten View Post
Let it be said here and forever more that Paula has a 7-bit "real" DAC that can source or sink (giving it sort-of 8-bits) but that has not-so-great linearity and an asymmetrical shape on the positive and negative side. This is then "chopped" with a 55kHz PWM based on a 6-bit volume before being mixed.
Sign + 7bit magnitude DAC but PWM is optional and some of problems observed in Paula may be associated with slow OPAMP used to convert I/V. Also linearity of Paula may be associated with PCB layout and other circuitry.

But in digital domain you are free from all this and you can create pure signal as desired by Amiga designers.
pandy71 is offline  
Old 27 September 2022, 22:36   #187
pandy71
Registered User
 
Join Date: Jun 2010
Location: PL?
Posts: 2,885
Quote:
Originally Posted by nonarkitten View Post
Rough block out?

Probably correct.
pandy71 is offline  
Old 27 September 2022, 23:17   #188
nonarkitten
Registered User
 
nonarkitten's Avatar
 
Join Date: Jun 2018
Location: Calgary/Canada
Posts: 247
Quote:
Originally Posted by pandy71 View Post
Well, 14 bit resolution as sample value 1 can be in one of the 64 (65) levels.

I use two 8 bit PWM as example that PDM need some time (or particular number of samples) to represent unique quantization step PCM as pulse density modulation need many samples averaged over time.

PWM or PDM are similar in such fashion - both need some time i.e. multiple samples where PCM need single sample. And from this perspective PDM is form of temporal dithering.
If you assume the Amiga can produce 14-bit, then maybe. But PDM does not quantize like PCM, so it's hard to say something like 44kHz * 256 is required for 8-bit audio.
nonarkitten is offline  
Old 27 September 2022, 23:20   #189
Gorf
Registered User
 
Gorf's Avatar
 
Join Date: May 2017
Location: Munich/Bavaria
Posts: 2,426
Quote:
Originally Posted by nonarkitten View Post
I guess the channel-mix is the only "undiscovered country" here.
As long as your implementation stays in the PDM realm channel mixing is of course just alternating between two inputs, resulting in a stream with twice the frequency ...

You could also use this to implement 64 volume levels:
clone the channel 64 times and then set one or many of them to "zero"(101010101 ....) and mix them all together. This would result in a 1.7*64MHz PDM signal ...
Gorf is offline  
Old 27 September 2022, 23:21   #190
nonarkitten
Registered User
 
nonarkitten's Avatar
 
Join Date: Jun 2018
Location: Calgary/Canada
Posts: 247
Quote:
Originally Posted by pandy71 View Post
Sign + 7bit magnitude DAC but PWM is optional and some of problems observed in Paula may be associated with slow OPAMP used to convert I/V. Also linearity of Paula may be associated with PCB layout and other circuitry.

But in digital domain you are free from all this and you can create pure signal as desired by Amiga designers.
Well, if we want DROP IN functionality, they my original idea of just being a flat PDM might not have worked. Knowing that Paula sources and sinks changes a lot. A 7-bit PDM also lets us double the PDM stream for free so our "idle tone" is now around 28kHz (yay!). Still haven't "solved" the 14-bit "problem", but my brain's chewing on it.
nonarkitten is offline  
Old 27 September 2022, 23:49   #191
pandy71
Registered User
 
Join Date: Jun 2010
Location: PL?
Posts: 2,885
Quote:
Originally Posted by nonarkitten View Post
If you assume the Amiga can produce 14-bit, then maybe. But PDM does not quantize like PCM, so it's hard to say something like 44kHz * 256 is required for 8-bit audio.
If 6 bit volume is used to control level of bit PCM then we can say about 14 bit as PWM is inherently linear (so 6 bits is linear and 8 may be nonlinear).
And of course PDM works different than PCM - for single multilevel PCM sample, PDM need many samples (they can be single or multilevel - more levels means lower quantization noise and stable higher order DSM).
If you design for example 4-th order DSM with 4 bit then for sure 14 bit audio should be reachable within sane frequency range.
4 bit PWM can be fed from DSM so linearity will be provided by design (for 4 bit PWM you need clock 16 times higher than for DSM).
multiplication 8 bit by 6 can be done in multiplier (parallel or serial).
biggest issue is sample rate - 3.58MHz may be to high and unnecessary from practical perspective - original I/V converter in Amiga use OPAMP like LF347/TL084 - IMHO they are to slow to deal with Paula signal, probably modern, fast OPAMP could remove some visible waveform distortions.

Quote:
Originally Posted by nonarkitten View Post
Well, if we want DROP IN functionality, they my original idea of just being a flat PDM might not have worked. Knowing that Paula sources and sinks changes a lot. A 7-bit PDM also lets us double the PDM stream for free so our "idle tone" is now around 28kHz (yay!). Still haven't "solved" the 14-bit "problem", but my brain's chewing on it.
Anyway this should be not a problem as OPAMP use half of Vcc as reference i.e. external bias is used to create '0' in Amiga.
Drop-in replacement should be possible.
pandy71 is offline  
Old 28 September 2022, 00:08   #192
Gorf
Registered User
 
Gorf's Avatar
 
Join Date: May 2017
Location: Munich/Bavaria
Posts: 2,426
Quote:
Originally Posted by nonarkitten View Post
Well, if we want DROP IN functionality, they my original idea of just being a flat PDM might not have worked. Knowing that Paula sources and sinks changes a lot. A 7-bit PDM also lets us double the PDM stream for free so our "idle tone" is now around 28kHz (yay!). Still haven't "solved" the 14-bit "problem", but my brain's chewing on it.
If the PDM frequency is too high in the method I suggested above, you can archive "14-bit" by a combination of right-shifting samples and 8-channel-clones mixed:

8 PDM streams, either signal or "zero", are mixed in the end ... that gives you 8 volume levels and a PDM frequency of 14 or 28 MHz ...

the initial 8bit sample could be right-shifted up to 8 times, which gives you another 8 levels of volume ...

Together we get 64 levels ... and a lot of silence and missing signal at very low volume, just as with original Paula
Gorf is offline  
Old 28 September 2022, 00:09   #193
nonarkitten
Registered User
 
nonarkitten's Avatar
 
Join Date: Jun 2018
Location: Calgary/Canada
Posts: 247
Quote:
Originally Posted by pandy71 View Post
If 6 bit volume is used to control level of bit PCM then we can say about 14 bit as PWM is inherently linear (so 6 bits is linear and 8 may be nonlinear).
And of course PDM works different than PCM - for single multilevel PCM sample, PDM need many samples (they can be single or multilevel - more levels means lower quantization noise and stable higher order DSM).
If you design for example 4-th order DSM with 4 bit then for sure 14 bit audio should be reachable within sane frequency range.
4 bit PWM can be fed from DSM so linearity will be provided by design (for 4 bit PWM you need clock 16 times higher than for DSM).
multiplication 8 bit by 6 can be done in multiplier (parallel or serial).
biggest issue is sample rate - 3.58MHz may be to high and unnecessary from practical perspective - original I/V converter in Amiga use OPAMP like LF347/TL084 - IMHO they are to slow to deal with Paula signal, probably modern, fast OPAMP could remove some visible waveform distortions.

Anyway this should be not a problem as OPAMP use half of Vcc as reference i.e. external bias is used to create '0' in Amiga.
Drop-in replacement should be possible.
Using a multiplier omits the 55kHz 'crunch' so no, I'm not doing it that way. While it's not possible to duplicate analog perfectly in FPGA, I'm not going to just shit on how Paula works and start "fixing it." I'm not so high on myself that I think Amiga even needs "fixing." I you don't like how the Amiga sounds, then you're already not depending on the real Amiga chips anymore.
nonarkitten is offline  
Old 28 September 2022, 00:26   #194
nonarkitten
Registered User
 
nonarkitten's Avatar
 
Join Date: Jun 2018
Location: Calgary/Canada
Posts: 247
Quote:
Originally Posted by Gorf View Post
If the PDM frequency is too high in the method I suggested above, you can archive "14-bit" by a combination of right-shifting samples and 8-channel-clones mixed:

8 PDM streams, either signal or "zero", are mixed in the end ... that gives you 8 volume levels and a PDM frequency of 14 or 28 MHz ...

the initial 8bit sample could be right-shifted up to 8 times, which gives you another 8 levels of volume ...

Together we get 64 levels ... and a lot of silence and missing signal at very low volume, just as with original Paula
Eight PDM streams? Amiga only has four channels.

We'd have four PWM streams.
- These are 55kHz volume PWMs.
- If these are LOW then the output is high-Z
- If these are HIGH then they pass the PDM

We'd have four PDM streams.
- These are signed binary streams (base-3-ish)
- We take the 7-bits + LSB of an LFSR into an 8-bit adder
- We use the carry out + original sample sign-bit
- L/R channel pairs are then summed into an accumulator
- If the sum carriers, we set the output high (source)
- If the sum borrows, we set the output low (sink)
- Otherwise we make the output high-Z

I think this is the most "electrically compatible" with Amiga's OpAmps. Obviously, the faster we can make the PDM go, the closer to "real analog" it can get. Right now it's too hot for me to think through the logic on a signed-binary adder.
nonarkitten is offline  
Old 28 September 2022, 00:35   #195
Gorf
Registered User
 
Gorf's Avatar
 
Join Date: May 2017
Location: Munich/Bavaria
Posts: 2,426
Quote:
Originally Posted by nonarkitten View Post
Eight PDM streams? Amiga only has four channels.
Sure.

But you could easily clone each channel 8 times ... just 8 taps on the line.
And you could make a switch on each tap - either real signal or "zero" (10101010...)

Then you mix all these taps together again, which means for PDM signals just alternating between them resulting in a 8x frequency ...
(we can convert this down again if needed..)

Now, depending how many taps carry the real signal and how many are "zero", you get 8 levels of volume!
Without any signal degradation. The magic of 1-bit signal processing.
Gorf is offline  
Old 28 September 2022, 02:17   #196
Gorf
Registered User
 
Gorf's Avatar
 
Join Date: May 2017
Location: Munich/Bavaria
Posts: 2,426
Quote:
Originally Posted by nonarkitten View Post
We'd have four PWM streams.
- These are 55kHz volume PWMs.
- If these are LOW then the output is high-Z
- If these are HIGH then they pass the PDM
There is in deed a problem with this method, as it changes the characteristics of the resulting PDM stream.
This will not only introduce a high frequency signal, that can easily be filtered, but also change lower frequencies, as soon as an analog signal will be formed.

Sure: this is also the case in the original Paula, but if you look at the measurements, that were done: the shape of the original wave is continued very good after the "break" ... that is something, that will not work the same way for PDM.

Example:

Code:
two perfect sine waves in PDM:
0101101111111111111101101010010000000000000100010011011101111111111111011010100100000000000000100101

with "half volume":

0101101110101010111101101010101000000000101010100011011110101010111111011010101000000000101010100101

(with 10101010 replacing every other block)

The result is anything but two sine waves ....

But if you mix it like I suggested, the simplest result (real signal + zero = half volume) would look like:

011001110011011101110111011101110111011001110011001100100110001000010001000100010001001100010010110010011011001110110011101110111011101110111011001110011001100100110001000100010001001000100010011000110011

same two sine waves, but at half the volume and encoded with double frequency...
This might be not that obvious in first hearing tests, since many MODs leave volume alone, but I think the distortion would be far grater than in original Paula...

Hence my suggestion to mix the PDM channel with zero-channels the "right way" in terms of 1-bit signal processing...

Last edited by Gorf; 28 September 2022 at 02:44.
Gorf is offline  
Old 28 September 2022, 03:01   #197
Gorf
Registered User
 
Gorf's Avatar
 
Join Date: May 2017
Location: Munich/Bavaria
Posts: 2,426
Quote:
Originally Posted by nonarkitten View Post
If you assume the Amiga can produce 14-bit, then maybe. But PDM does not quantize like PCM, so it's hard to say something like 44kHz * 256 is required for 8-bit audio.
Naa .. you don't need that high frequencies.
Compare it to the Super Audio CD:

The PDM Stream is 2.8224 MHz on a SACD ... that is only 64 times 44.1 kHz!
And still it sounds better than normal CDs.
Gorf is offline  
Old 28 September 2022, 06:16   #198
nonarkitten
Registered User
 
nonarkitten's Avatar
 
Join Date: Jun 2018
Location: Calgary/Canada
Posts: 247
Umm, no. First, that sine wave is 35kHz and I'm not sure the Amiga hardware would emit something like this even if you drove it at 56kHz. That aside, your bit stream is wrong.
Code:
PDM 0101101111111111111101101010010000000000000100010011011101111111111111011010100100000000000000100101
PCM 1111111111111111111111111111111100000000000000000000000000000000111111111111111111111111111111110000
OUT 0101101111111111111101101010010000000000000000000000000000000000111111011010100100000000000000100000
Which would be exactly as "choppy" as a real Amiga.
nonarkitten is offline  
Old 28 September 2022, 08:50   #199
Mathesar
Registered User
 
Mathesar's Avatar
 
Join Date: Aug 2014
Location: Netherlands
Posts: 701
Quote:
Originally Posted by nonarkitten View Post
OMG I was just thinking of this.
<snip>
So you're right, to drive this right we need a signal that can PDM between high and high-z for + signals and low and high-z for negative signals. That's pretty easy -- something like:
Code:
if (sample[7]) out <= bitstream ? 1'b0 : 1'bz;
else out <= bitstream ? 1'b1 : 1'bz;
Yes! That would mimic the output of a real Paula quite well and be easy to implement. You'd still have to find a way to implement the volume control though as discussed while I was sleeping

Another thought, besides sigma-delta modulators there also exist MASH modulators. MASH modulators are inherently stable and thus easier to implement than higher order sigma-delta modulators. MASH needs a multibit final converter though but that can be implemented via PWM. A second order MASH modulator will already make a big difference and output (-1,0,+1,+2) which can be easily constructed using the tristate trick.
This link explains it very clearly:
http://www.aholme.co.uk/Frac2/Mash.htm

Many moons ago I used it to construct a fractional PLL that had sub-Hz resolution and very low phase-noise for a telemetry receiver. That was using a MAX-II CPLD.
Mathesar is offline  
Old 28 September 2022, 09:58   #200
Gorf
Registered User
 
Gorf's Avatar
 
Join Date: May 2017
Location: Munich/Bavaria
Posts: 2,426
Quote:
Originally Posted by nonarkitten View Post
Umm, no. First, that sine wave is 35kHz and I'm not sure the Amiga hardware would emit something like this even if you drove it at 56kHz.
I did not specify any frequency… this was just a example to illustrate the problem.
Quote:
That aside, your bit stream is wrong.
Code:
PDM 0101101111111111111101101010010000000000000100010011011101111111111111011010100100000000000000100101
PCM 1111111111111111111111111111111100000000000000000000000000000000111111111111111111111111111111110000
OUT 0101101111111111111101101010010000000000000000000000000000000000111111011010100100000000000000100000
Which would be exactly as "choppy" as a real Amiga.
Your "PCM" signal should be "PWM", I guess?

On PDM "zero" or "no output" is a clock signal, that averages to 0.5, that is why I inserted 10101010…
You cannot simply set the signal to 00000000… , since this is a maximum/minimum value in PDM.

Last edited by Gorf; 28 September 2022 at 10:10.
Gorf 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
Amiga 500 and Agnus cleaning without removing Agnus? turrican9 support.Hardware 16 26 January 2016 16:05
Universal Translator mritter0 request.Apps 2 14 June 2014 19:28
Universal Warrior Asle HOL data problems 4 10 September 2011 22:14
swap fat agnus with agnus extralife support.Hardware 12 23 July 2008 15:35

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 17:35.

Top

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