![]() |
![]() |
#81 | |
Registered User
Join Date: May 2017
Location: Munich/Bavaria
Posts: 2,502
|
Quote:
To get to "zero" it alternates pulses: So what Paula does is to change its operation mode for volume 63 and below. It establishes the aforementioned raster of T = 64/3579545s in which it will perform an operation cycle similar to a PWM. Within each cycle, an impulse is generated which will be canceled out by a negative impulse of the same amplitude after a number of time steps corresponding to the volume setting, i.e. Tv = v/3579545s with v ? [1...63]. http://bax.comlab.uni-rostock.de/dl/...mTheoretic.pdf Last edited by Gorf; 31 May 2024 at 23:51. |
|
![]() |
![]() |
#82 | |
Registered User
Join Date: Feb 2018
Location: Poland
Posts: 376
|
Quote:
|
|
![]() |
![]() |
#83 | |
Registered User
Join Date: Jun 2010
Location: PL?
Posts: 2,919
|
Quote:
|
|
![]() |
![]() |
#84 | |
Registered User
Join Date: May 2017
Location: Munich/Bavaria
Posts: 2,502
|
Somewhere here on EAB Toni uploaded a oscilloscope screenshot of that volume reduction behavior, but sadly I can't find it anymore ...
only this quote: Quote:
Last edited by Gorf; 01 June 2024 at 02:06. |
|
![]() |
![]() |
#85 | |
Alien Bleed
Join Date: Aug 2022
Location: UK
Posts: 4,877
|
Quote:
|
|
![]() |
![]() |
#86 | |
Registered User
Join Date: Jul 2009
Location: Lala Land
Posts: 608
|
Quote:
https://eab.abime.net/showpost.php?p=824979&postcount=6 |
|
![]() |
![]() |
#87 | |
Registered User
Join Date: May 2017
Location: Munich/Bavaria
Posts: 2,502
|
Quote:
(maybe it was even a short video?) |
|
![]() |
![]() |
#88 |
Registered User
Join Date: Aug 2010
Location: Italy
Posts: 901
|
@Pandy
I ran the scripts using the last 5 seconds of the Sony example music. The resulting sound, in both cases, differes strongly from the original one and is affected by perceivable noise. For comparison, I also downsampled the same snippet with Audacity to 16-bit and then converted it to 14-bit. Despite all the issues that affect the 14-bit playback, it still is better by far. Here are the files: original, 96000, 24-bit Audacity, 64489, 14-bit, AQA1 Audacity, 64489, 16-bit, WAV Audacity, 192000, 32-bit, WAV, sampled from A1200 script 1, 64489, 8-bit, AQA0 script 1, 64489, 8-bit, WAV script 1, 192000, 32-bit, WAV, sampled from A1200 script 2, 64489, 8-bit, AQA0 script 2, 64489, 8-bit, WAV script 2, 192000, 32-bit, WAV, sampled from A1200 waveforms and spectograms pictures Side note 1: the second script also generated a 48000 Hz 24-bit file, which I did not test. Side note 2: the WAV->AQA converters processed the WAVs just fine, so, even if the scripts specify signed-integer, the data must be unsigned anyway (I searched around it does look like WAVs are always unsigned when the resolution is 8-bit). Last edited by saimo; 02 June 2024 at 14:58. Reason: Fixed typo. |
![]() |
![]() |
#89 | ||
Registered User
Join Date: Jun 2010
Location: PL?
Posts: 2,919
|
Quote:
You can try to generate 16 bit with 14 bit or lower precission and with noise shaping - modifying parameter 'p' (dither -f %noiseshp% -p 8) from 8 to for example 12 or 13 or 14 overall noise level perceived by noiseshaping will be significantly suppressed - with '-p 12' you probably will not hear any noise yet overall dynamics will be improved. Of course instead 8 bit file you need to use 16 bit file - also you may wish to apply level reduction to 14 bit (by applying gain 'gain -n -12.0411998265592' before so in theory 16 bit will have 14 bit data and noise shaping to additionally improve dynamics and can be mapped directly to Amiga). Quote:
Checked carefully logs - obviously SoX silently ignore switch to produce signed integer 8 bit PCM wav and use unsigned integer 8 bit instead so your assumption on wav file is probably right- they accept in 8 bit PCM only unsigned integer and that's why your converter works correctly. |
||
![]() |
![]() |
#90 | ||
Registered User
Join Date: Aug 2010
Location: Italy
Posts: 901
|
Quote:
Quote:
|
||
![]() |
![]() |
#91 | |
Registered User
Join Date: May 2017
Location: Munich/Bavaria
Posts: 2,502
|
Quote:
Some may be due to the differences in A500 vs. 1200 low-pass. This needs to be addressed. I actually would not apply any equalizer or compensation for the Amiga low-pass just yet. This can be done a a very last stage, when everything else is working. Otherwise it is hard to tell apart what is doing what.. The dithering is also overdone in my opinion and should be scaled down - it shouldn't be that noticeable but barely audible. Just used a a trick to assist the noise shaping step. |
|
![]() |
![]() |
#92 |
Registered User
Join Date: Jun 2010
Location: PL?
Posts: 2,919
|
With more aggressive noise shaping filter, better tuned to Amiga sampling frequencies (i mean not standard like 44.1, 48 etc) you can achieve IMHO very good result.
Made some filter for Sebastian G. application (noise.zip in the Zone) and results are more than 16 bits dynamic (approx 112dB so closer to 18 bit). Providing filter (added txt extension to upload filter - sos is just set of coefficients for filter), small script and spectrogram on dynamic test (signal level sweep). Sadly to say but requent.jar not accepting 24 bit files (i failed to requantize 24 wav so forced to use 16 bit as source - seem java has some issue with opening 24 bit files - perhaps there is issue with some wav structure as author mention support for 8..24 bit support), detected this recently - seem also there is issue with size of file - even few ten MB seem to be no go for this software - as such there is PITA unless someone will write software doing requantization in similar fashion - i'm not coder... Script accepting source filename as first parameter and noiseshaping filter as second parameter - there is possibility to change gain (to prevent dither clipping when signal is close to 0dBFS - this is visible on spectrogram) and also allow to change dither type (float in range 0..2) - based on author description: Code:
0 = off 0.5 = rectangular (+/- 1/4 LSB) 1 = full rectangular (+/- 1/2 LSB) 1.5 = half-way between 1 and 2 (morphed) 2 = full triangular (+/- 2/2 LSB) Code:
@setlocal @echo off @SET file=%1 @SET fname=%~n1 @SET GAIN=1.0 @SET DITHER=1.0 @java -jar requant.jar %file% %fname%_%~n2.wav 8 %GAIN% -d%DITHER% -s@%2 @endlocal @pause Last edited by pandy71; 02 June 2024 at 23:47. |
![]() |
![]() |
#93 | |
Registered User
Join Date: Aug 2010
Location: Italy
Posts: 901
|
@Gorf
Quote:
@pandy71 If I'm not asking too much, could you to provide directly the sample processed with your latest script, please? I don't fancy installing Java just to make a test. @all I just finished making other tests. I think that they prove that: * Paula resets the volume counter also for the second sample; * volume works better than expected (although not perfectly) also at periods < 64. I'll provide pictures and files in the evening, after work. Last edited by saimo; 10 June 2024 at 23:19. Reason: Fixed typo. |
|
![]() |
![]() |
#94 | |
Registered User
Join Date: Jun 2010
Location: PL?
Posts: 2,919
|
Quote:
|
|
![]() |
![]() |
#95 |
Registered User
Join Date: Aug 2010
Location: Italy
Posts: 901
|
Here are the findings from my latests tests.
Please keep in mind that all the equipment I have this humble ASRock J5040-ITX PC with its anonymous on-board audio chip, my A1200 and a cheap audio cable connected to the A1200 RCAs and the PC line-in. I sampled the output of the Amiga at 192000 Hz, the maximum allowed by the PC (initially I had used 55420*3 = 166260 Hz, but that was too little for period 24, it wasn't exact because 3546895/64 is not 55420 precisely anyway and because there is no way to sync the start of the playback and of the recording). Click the pictures to see them in full size. I generated a 13855 Hz square wave, sampling it at 13855*4 = 55420 Hz (so that, for each cycle, there were 2 "up" samples and two "down" samples ) and used it for both the left and right channels: ![]() Below is the output sampled with various volumes and periods. First off, output at volume 64 and period 64, to see if Paula's output is sane with such "perfect" values: ![]() (The output got clipped a little bit, so it was a bit more than 60 dB, contrary to the previous measurements made with a sinusoid.) Then, output with halved period (32) - given that the volume remained 64, the amplitude was expected not to (and did not) change: ![]() Another test to check that the output is sane in normal conditions - here the left channel is played at volume 32 (with the period restored to 64 for both channels): ![]() Now the first "real" test: what happens with volume and period both set to 32? If one looked at just the counters, the amplitude should always be maximum, as the volume counter never reaches 32; instead, Paula presents a nice surprise: ![]() Paula adapted to the period! However, the adaption was not perfect: ![]() Consider especially the more wavy contour and the spikes, as the initial part is irregular also when the parameters are perfectly "normal": it's as if Paula needs a settling period (sorry, I was too tired to investigate this specific aspect; EDIT: it occurred to me later that this might be caused by a bug in the buffering initialization of the player; EDIT2: nope, the code is fine; also, checking the waveforms, it turns out that the settling period is about 2000*period/64 samples long - maybe Paula uses an internal buffer of 2 kB per channel? EDIT 3: as reported later, the problem was in the source test sample - please ignore these ramblings about the settling period); here's a zoomed in view of the samples beginning: ![]() Also, the amplitude attenuation was inferior (I measured the amplitude where there are no spikes; the absolute values are for sure totally unreliable, but their comparison is definitely meaningful): * period 64: -6.128 dB (keep in mind that this is affected by clipping; the AHRM says it should be -6 dB) * period 32: -5.180 dB Such surprise suggested me to check the output also at period 50 (the one used by the demo) and 24 (a very small one; I didn't go further because the corresponding frequency is already 147787.292 Hz, i.e. a bit too much for the 192000 Hz sampling limit): ![]() I measured the attenuation also in these cases; putting them together suggests a (linear? the measurements are way too imprecise to say) relationship between period and volume according to which the smaller the former, the less accurate the latter: * period 64: -6.128 dB * period 50: -5.331 dB * period 32: -5.180 dB * period 24: -4.883 dB Then I repeated the same procedure for volume 1, to get an idea of how (much more) distorted is the 14-bit playback at a period < 64: ![]() * period 64: -34.921 dB (the AHRM says it should be -36.1 dB) * period 50: -33.672 dB * period 32: -32.291 dB * period 24: -31.772 dB (Wishful thinking follows) With precise measurements, maybe it could be possible to determine the (linear? logarithmic?) equation to recalculate the amplitude of samples to compensate the distortions introduced by periods smaller than 64. (Note: my bet is that some distortions happen also with periods greater than 64 but not multiple of it, but I'm just too tired to make other tests - this stuff is taking too much of my time and limited energies...). Finally, while at it, I thought I'd make a test to see whether the volume counter resets for the second sample of each word. I shifted the left channel by 1 sample and played the channel at volume 32 and period 32: if the counter did not reset, the left and right channels would look definitely different; instead they look "perfect": ![]() (Note: maybe the volume compensation mechanism of Paula plays a role?) I suggest that you have a closer look at the data yourself: WAVs and pictures archive. Last edited by saimo; 10 June 2024 at 23:23. Reason: Fixed broken English. |
![]() |
![]() |
#96 | |
Registered User
Join Date: Aug 2010
Location: Italy
Posts: 901
|
Quote:
I tested just the last 10 seconds or so, as I don't have a quick way to transfer large files to the A1200 and, anyway, those 10 seconds are enough for quality evaluation. Here are the results: 8-bit 16-bit Unfortunately, in both cases the noise is pretty audible (especially in the 8-bit case), but, more importantly than that, the problem is that the sound is still just too different: the lower frequencies got lost, so both sound much thinner than the original. A consideration: I don't think that for 14-bit playback any (heavy) dithering/noise shaping is necessary, as the sound is already clean as it is - there, the problem is the distortion due to volume regulation as discussed in the previous posts. Check out the demo music again: that's been exported from Audacity without any dithering or noise shaping (and the output is also affected by the lesser volume attenuation due to the period 50, as reported in the previous post). Afterwards, I tried also those options, and I have a really hard time distinguishing the results. After all these tests, I think that the best solution to achieve high quality are: * sticking to period 64 to avoid volume distorsions; * 14-bit playback with or, to avoid calibration issues... * ... 8-bit + amplitude modulation (hmmm... isn't also AM subject to calibration issues, after all?) Last edited by saimo; 10 June 2024 at 23:28. Reason: Fixed broken English. |
|
![]() |
![]() |
#97 | ||||
Registered User
Join Date: Jun 2010
Location: PL?
Posts: 2,919
|
Quote:
Of course i can prepare samples without such boost and also sample length to 10 seconds to address your setup specification. Quote:
Quote:
That's why i provided 24 bit files with "play" in name - this is 24 bit produced from 8 bit samples - only lowpass filtering (to simulate Amiga audio signal path) and resampling (to deal with PC audio card specify). Except this two steps you can hear 8 bit sound. Amiga need no resampling and automatically apply lowpass filtering so in analog domain this should work fine. Btw about 14 bit with noise shaping - probably this description will the best argument for noise shaped 14 bit: Quote:
Last edited by pandy71; 05 June 2024 at 01:34. |
||||
![]() |
![]() |
#98 |
Alien Bleed
Join Date: Aug 2022
Location: UK
Posts: 4,877
|
I don't know if you guys have seen this, but there's a lot of interesting info here: http://bax.comlab.uni-rostock.de/dl/...mTheoretic.pdf
|
![]() |
![]() |
#99 | |
Registered User
Join Date: May 2017
Location: Munich/Bavaria
Posts: 2,502
|
Quote:
|
|
![]() |
![]() |
#100 |
Registered User
Join Date: Aug 2010
Location: Italy
Posts: 901
|
@all
Quote:
|
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
ArtPazz - New game for AGA Amigas [WIP] | saimo | Amiga scene | 38 | 07 June 2023 15:08 |
RNOPDF for ECS/AGA Amigas released | jPV | News | 5 | 10 July 2020 07:57 |
Recommend a good Hertz switcher? | lordofchaos | request.Apps | 5 | 28 June 2013 04:55 |
How does a 50 Hertz image get displayed? | Richardcavell | Coders. Asm / Hardware | 14 | 15 March 2013 13:59 |
AGA Amigas | Kitty | Retrogaming General Discussion | 25 | 13 October 2009 12:56 |
|
|