Author Topic: Anyone to make sound measurements with an oscilloscope?  (Read 1529 times)

0 Members and 1 Guest are viewing this topic.

Offline Targhan

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.322
  • Country: fr
  • Liked: 1244
  • Likes Given: 186
Re: Anyone to make sound measurements with an oscilloscope?
« Reply #25 on: 20:04, 17 April 21 »
>Why does the program crash the CPC and mess up the screen? Is that correct? Surely you could have just created those sounds in BASIC?

Huh, there is a basic loader loading and executing a binary program. I tested all this on a real CPC, it works fine. I created them using AT2 because it gives me more control over the sounds I want.
Please PM if you want something else, you have my email.

Edit: ok it seems you want each sound in a different program. I'll do that and sent it again to you. I don't know your process, I expected you to record everything, then "simply" take "pictures" of the signal at precise instants.
« Last Edit: 20:06, 17 April 21 by Targhan »
Targhan/Arkos

Arkos Tracker 2.0.1 now released! - Follow the news on Twitter!
Disark - A cross-platform Z80 disassembler/source converter
FDC Tool 1.1 - Read Amsdos files without the system

Imperial Mahjong
Orion Prime

Offline Bryce

  • The Hardware Guy.
  • Supporter
  • 6128 Plus
  • *
  • Posts: 12.230
  • Country: wf
  • It's not broken, it just hasn't been fixed yet.
    • index.php?action=treasury
  • Liked: 4543
  • Likes Given: 476
Re: Anyone to make sound measurements with an oscilloscope?
« Reply #26 on: 21:04, 17 April 21 »
No, that's not the way it works. You can take long samples, but you loose the resolution. To properly zoom in on a single wave and see the details, you need to be taking lots of samples over a short time.

Bryce.

Offline Targhan

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.322
  • Country: fr
  • Liked: 1244
  • Likes Given: 186
Re: Anyone to make sound measurements with an oscilloscope?
« Reply #27 on: 21:35, 17 April 21 »
Ok no problem. I'll come with another program :).
Targhan/Arkos

Arkos Tracker 2.0.1 now released! - Follow the news on Twitter!
Disark - A cross-platform Z80 disassembler/source converter
FDC Tool 1.1 - Read Amsdos files without the system

Imperial Mahjong
Orion Prime

Offline Targhan

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.322
  • Country: fr
  • Liked: 1244
  • Likes Given: 186
Re: Anyone to make sound measurements with an oscilloscope?
« Reply #28 on: 22:25, 17 April 21 »
Done, PMed you.
Targhan/Arkos

Arkos Tracker 2.0.1 now released! - Follow the news on Twitter!
Disark - A cross-platform Z80 disassembler/source converter
FDC Tool 1.1 - Read Amsdos files without the system

Imperial Mahjong
Orion Prime

Offline Animalgril987

  • Supporter
  • CPC664
  • *
  • Posts: 137
  • Country: gb
  • Liked: 62
  • Likes Given: 146
Re: Anyone to make sound measurements with an oscilloscope?
« Reply #29 on: 01:57, 18 April 21 »
14kHz is the upper limit for me.  :'(

Offline Bryce

  • The Hardware Guy.
  • Supporter
  • 6128 Plus
  • *
  • Posts: 12.230
  • Country: wf
  • It's not broken, it just hasn't been fixed yet.
    • index.php?action=treasury
  • Liked: 4543
  • Likes Given: 476
Re: Anyone to make sound measurements with an oscilloscope?
« Reply #30 on: 13:58, 25 April 21 »
Hi,
I had some time this morning and set up the test. Unfortunately, most of the sounds are non-symetrical, so they don't trigger properly and don't really tell much.

As the frequencies are so low, I can't measure them on a Spectrum Analyser. They only start at 9kHz.


Bryce.


Offline Targhan

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.322
  • Country: fr
  • Liked: 1244
  • Likes Given: 186
Re: Anyone to make sound measurements with an oscilloscope?
« Reply #31 on: 23:46, 26 April 21 »
Thanks a lot for this!

- If the period is too low, and if you have time and want to make another test, simply change the "v=&ef" value line 1000 in the code I sent you. The smaller, the higher the sound.
- I guess the yellow line is the left signal, the blue one the right?
- From what I see, the signal seems perfectly square. No "round curves". Can I deduce from that that the sound generation of the PSG is pretty accurate and does not produce "lazy" square envelopes?
« Last Edit: 23:50, 26 April 21 by Targhan »
Targhan/Arkos

Arkos Tracker 2.0.1 now released! - Follow the news on Twitter!
Disark - A cross-platform Z80 disassembler/source converter
FDC Tool 1.1 - Read Amsdos files without the system

Imperial Mahjong
Orion Prime

Offline Bryce

  • The Hardware Guy.
  • Supporter
  • 6128 Plus
  • *
  • Posts: 12.230
  • Country: wf
  • It's not broken, it just hasn't been fixed yet.
    • index.php?action=treasury
  • Liked: 4543
  • Likes Given: 476
Re: Anyone to make sound measurements with an oscilloscope?
« Reply #32 on: 10:19, 27 April 21 »
The squareness of the wave is also due to the very low frequency. The higher it goes, the rounder it would become.

When I get time I'll do some examples of higher frequencies.

Bryce.

Offline Targhan

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.322
  • Country: fr
  • Liked: 1244
  • Likes Given: 186
Re: Anyone to make sound measurements with an oscilloscope?
« Reply #33 on: 13:56, 27 April 21 »
That would be great, thanks!

The funny thing is that, from your standpoint, you consider the frequency as "very low", but they are actually pretty high, musically speaking.
« Last Edit: 13:58, 27 April 21 by Targhan »
Targhan/Arkos

Arkos Tracker 2.0.1 now released! - Follow the news on Twitter!
Disark - A cross-platform Z80 disassembler/source converter
FDC Tool 1.1 - Read Amsdos files without the system

Imperial Mahjong
Orion Prime

Offline Bryce

  • The Hardware Guy.
  • Supporter
  • 6128 Plus
  • *
  • Posts: 12.230
  • Country: wf
  • It's not broken, it just hasn't been fixed yet.
    • index.php?action=treasury
  • Liked: 4543
  • Likes Given: 476
Re: Anyone to make sound measurements with an oscilloscope?
« Reply #34 on: 15:25, 27 April 21 »
That would be great, thanks!

The funny thing is that, from your standpoint, you consider the frequency as "very low", but they are actually pretty high, musically speaking.

The base frequency of your sample is approx. 262Hz which is middle C on a piano, so it's dead centre from a music perspective, but on the scale of what a human can hear (20Hz - 20kHz) it's pretty low down on the scale* and from a physics / electronics perspective it's extremely low.

Bryce.

*Yes I'm aware that hearing sensitivity is logarithmic so it's not quite as low as I state.

Offline VintageAdvantage

  • CPC6128
  • ****
  • Posts: 291
  • Country: us
  • Liked: 127
  • Likes Given: 154
Re: Anyone to make sound measurements with an oscilloscope?
« Reply #35 on: 18:05, 27 April 21 »
The squareness of the wave is also due to the very low frequency. The higher it goes, the rounder it would become.

Which is usually a sign of an oscilloscope reaching its bandwidth / sample frequency limits, right? For the CPC clock, this shows up even with decent enough starter oscilloscopes. E.g., with my 80 MHz Hantek, the CPC clock doesn't look squareish at all, but already much more like Sinus Wave.

I guess 100 Mhz is already the min for 4 MHz system. Well, square waves have high frequency harmonic content in its Fourier spectrum, and if you can't capture these due to bandwith limits of the scope, it gets roundish.

For audio, it shouldn't be a problem though. Not even for these B***S*** 50 $ pocket oscilloscopes on EBay.
« Last Edit: 18:08, 27 April 21 by VintageAdvantage »

Offline m_dr_m

  • CPC6128
  • ****
  • Posts: 185
  • Country: se
  • http://orgams.wikidot.com/
    • OrgaMS!
  • Liked: 113
  • Likes Given: 129
Re: Anyone to make sound measurements with an oscilloscope?
« Reply #36 on: 20:55, 27 April 21 »
The noise looks so cool!
Also, there are pretty fast state switches. High frequency by the PSG, and 3 octaves lower square modulation by hand?
Were you tickled by BSC's great gritty sounds?

Offline Targhan

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.322
  • Country: fr
  • Liked: 1244
  • Likes Given: 186
Re: Anyone to make sound measurements with an oscilloscope?
« Reply #37 on: 23:50, 27 April 21 »
You're going to be disappointed, it's only basic square sound, without then with noise, then noise only :).
Targhan/Arkos

Arkos Tracker 2.0.1 now released! - Follow the news on Twitter!
Disark - A cross-platform Z80 disassembler/source converter
FDC Tool 1.1 - Read Amsdos files without the system

Imperial Mahjong
Orion Prime

Offline m_dr_m

  • CPC6128
  • ****
  • Posts: 185
  • Country: se
  • http://orgams.wikidot.com/
    • OrgaMS!
  • Liked: 113
  • Likes Given: 129
Re: Anyone to make sound measurements with an oscilloscope?
« Reply #38 on: 15:56, 28 April 21 »
Oh, so in sound4.png, you have a sound in each channel? Even if it's the case, that's doesn't square for me!


Yes, your father and I are very disappointed by your behaviour!

Offline Targhan

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.322
  • Country: fr
  • Liked: 1244
  • Likes Given: 186
Re: Anyone to make sound measurements with an oscilloscope?
« Reply #39 on: 16:10, 28 April 21 »
Oh, so in sound4.png, you have a sound in each channel? Even if it's the case, that's doesn't square for me!
The sound is only played on the center channel, so what I see on sound4 is the same signal L and R. It looks very square to me.
Targhan/Arkos

Arkos Tracker 2.0.1 now released! - Follow the news on Twitter!
Disark - A cross-platform Z80 disassembler/source converter
FDC Tool 1.1 - Read Amsdos files without the system

Imperial Mahjong
Orion Prime

Offline Bryce

  • The Hardware Guy.
  • Supporter
  • 6128 Plus
  • *
  • Posts: 12.230
  • Country: wf
  • It's not broken, it just hasn't been fixed yet.
    • index.php?action=treasury
  • Liked: 4543
  • Likes Given: 476
Re: Anyone to make sound measurements with an oscilloscope?
« Reply #40 on: 16:28, 28 April 21 »
That's because it is square. Sound signals don't need to be a sinewave.

Bryce.

Offline m_dr_m

  • CPC6128
  • ****
  • Posts: 185
  • Country: se
  • http://orgams.wikidot.com/
    • OrgaMS!
  • Liked: 113
  • Likes Given: 129
Re: Anyone to make sound measurements with an oscilloscope?
« Reply #41 on: 16:47, 28 April 21 »
Sound1 is square.
In Sound4, there is state alternance inside the slower state alternance! (not taking about the noise (*) but the tiny fragments on either high or low state).
That is typical of 'ring square modulation' (multiplication of 2 square signals).


It could also be achieved by a very fast and well synchronised arpeggio (i.e. the switch of periods is done at same frequency than 2* the lower sound).
If you can generate either from basic, you have all my attention.


(*) Well, maybe it's just the pseudo-random state of the noise staying constant for a while.

Offline Bryce

  • The Hardware Guy.
  • Supporter
  • 6128 Plus
  • *
  • Posts: 12.230
  • Country: wf
  • It's not broken, it just hasn't been fixed yet.
    • index.php?action=treasury
  • Liked: 4543
  • Likes Given: 476
Re: Anyone to make sound measurements with an oscilloscope?
« Reply #42 on: 16:55, 28 April 21 »
Which is usually a sign of an oscilloscope reaching its bandwidth / sample frequency limits, right? For the CPC clock, this shows up even with decent enough starter oscilloscopes. E.g., with my 80 MHz Hantek, the CPC clock doesn't look squareish at all, but already much more like Sinus Wave.

I guess 100 Mhz is already the min for 4 MHz system. Well, square waves have high frequency harmonic content in its Fourier spectrum, and if you can't capture these due to bandwith limits of the scope, it gets roundish.

For audio, it shouldn't be a problem though. Not even for these B***S*** 50 $ pocket oscilloscopes on EBay.

It can be caused by the scope not having the bandwidth, but in the case of a sound signal obviously it would be other factors causing the roundness. Parasitic capacitance and inductance will round the wave, transistor switching times will round the wave and the miller effect can also cause it.
For a good looking square wave you need a scope with at least 10 times the bandwidth of the fundamental wave so you would expect a 40MHz scope to be enough for 4Mhz. However, the sample rate is also important, so even a 100Mhz scope will show a strange square wave if it the sample rate is too low. 

Bryce.
« Last Edit: 17:12, 28 April 21 by Bryce »

Offline Targhan

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.322
  • Country: fr
  • Liked: 1244
  • Likes Given: 186
Re: Anyone to make sound measurements with an oscilloscope?
« Reply #43 on: 18:10, 28 April 21 »
In Sound4, there is state alternance inside the slower state alternance!
You're right. No idea what they are! Like I told you, it's only sound + noise, generated in Basic...
Targhan/Arkos

Arkos Tracker 2.0.1 now released! - Follow the news on Twitter!
Disark - A cross-platform Z80 disassembler/source converter
FDC Tool 1.1 - Read Amsdos files without the system

Imperial Mahjong
Orion Prime

Offline BSC

  • 464 Plus
  • *****
  • Posts: 307
  • Country: de
  • CPC 464 aspirant
    • my (Android) mobile game
  • Liked: 444
  • Likes Given: 385
Re: Anyone to make sound measurements with an oscilloscope?
« Reply #44 on: 14:33, 30 April 21 »
So, Targhan, can you already conclude what you were trying to find out here?

Offline Targhan

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.322
  • Country: fr
  • Liked: 1244
  • Likes Given: 186
Re: Anyone to make sound measurements with an oscilloscope?
« Reply #45 on: 20:55, 30 April 21 »
So, Targhan, can you already conclude what you were trying to find out here?
I don't think I am the one would can conclude, only based on screenshots. Bryce can, but maybe we should wait for new recording using higher frequencies.
Basically, I just wanted to be sure that the PSG was producing perfectly or almost perfectly squared envelopes (as Sylvestre showed in his page which I linked earlier). When recording music using a sound card, I noticed very strange stuff, which I thought was because of the PSG. It seems to turn out it is just because of filters modern sound card have.

So basically, it seems the PSG doesn't do crazy stuff :). I emulated some of the strange stuff I noticed, in Arkos Tracker 1 (mostly when using noise), but removed it for AT2 (which turned out to be a wise move).
Targhan/Arkos

Arkos Tracker 2.0.1 now released! - Follow the news on Twitter!
Disark - A cross-platform Z80 disassembler/source converter
FDC Tool 1.1 - Read Amsdos files without the system

Imperial Mahjong
Orion Prime

Offline Bryce

  • The Hardware Guy.
  • Supporter
  • 6128 Plus
  • *
  • Posts: 12.230
  • Country: wf
  • It's not broken, it just hasn't been fixed yet.
    • index.php?action=treasury
  • Liked: 4543
  • Likes Given: 476
This might go above the heads of many here, but just for the fun of it, I analysed the highest frequency the CPC can create: Sound 2,1 which is for me at least not possible to hear.
The higher the frequency, the more expected distortion (and the easier it is for me to analyse the spectrum).

The first screenshot is taken on a 100MHz oscilloscope. This means that I am theoretically measuring up to the 1611th Harmonic (if it actually existed), so any rounding seen is due to the limits of the CPC and not the scope. As you can see, the wave is still relatively square. The rounding on the leading edges will be due to capacitance on the CPC's PCB and parasitic properties of the resistors used to merge the channels. The noise seen on the top and bottom of the waves is most likely the CPC's clocks and switching noise from other parts of the circuit. But it's at a frequency that no speaker could reproduce, no ear could hear and it's volume is tiny anyway (20mV peak to peak).

The second screenshot is a spectrum analysis of the same signal. Here you can see the fundamental frequency on the left (62.19kHz) plus the 3rd, 5th, 7th and 9th harmonic. There is a tiny 4th, 6th and 8th harmonic which contributes to the rounding, but as you can see they are 30dB below the fundamental frequency and would normally be ignored in most calculations unless I was dealing with highly sensitive GHz signals.

Btw, the actual frequency is 62,190kHz as the SA reports, not the 62.5kHz that the Oscilloscope reports. Spectrum analysers are much more accurate than scopes for measuring frequencies. The ramp up of the noise floor on the left is because the SA is approaching it's lowest frequency limit (9kHz).

So to answer the original question: The CPC produces an extremely clean, as square as possible (for the electronics in a CPC) wave.

Bryce.
« Last Edit: 16:49, 01 May 21 by Bryce »

Online RetroCPC

  • CPC664
  • ***
  • Posts: 103
  • Country: hk
  • Liked: 36
  • Likes Given: 45
Bryce,

Is the component on Marker 1 the square-wave frequency?

If so, the SNR is very poor - with a wide band Spectrum NF only 30dB down?

When you short the input of your SA do you still see such a rising noise-floor?

Listening to the CPC speaker "whine" I would expect the NF to be rising as seen on your SA - in fact worst if the SA lower limit is 9KHz.

You can see the fuzz on the Square wave peaks gives you an idea of the wide-band noise levels.

As you say, to be expected from a consumer "budget" home computer design back in the 80's.
« Last Edit: 18:21, 01 May 21 by RetroCPC »

Offline Bryce

  • The Hardware Guy.
  • Supporter
  • 6128 Plus
  • *
  • Posts: 12.230
  • Country: wf
  • It's not broken, it just hasn't been fixed yet.
    • index.php?action=treasury
  • Liked: 4543
  • Likes Given: 476
Marker 1 is the fundamental frequency, but the SNR is not a component of the CPC, rather the fact that I am measuring a 62kHz signal on a Spectrum Analyser that has a range from 9kHz to 3.2GHz. So as expected the noise floor is raised at both ends of that spectrum and the signal I'm measuring is at the very lower limit of that spectrum. If I short the SA input, obviously, the noise floor drops to the level of the SA'S internal noise and is almost a straight line.

The CPC is an 8 bit computer, why would I expect the SNR to be anywhere close to some high-end audio equipment? The "fuzz" as you call it is the switching noise from the CPC's circuitry and at 30dB down is pretty good for a non-shielded TTL circuit with a cheap-ass AY where they didn't even bother to have separate grounds for the analogue and digital portions.

Bryce.
 

Online RetroCPC

  • CPC664
  • ***
  • Posts: 103
  • Country: hk
  • Liked: 36
  • Likes Given: 45
Hi Bryce,

I'm not convinced that the noise at the bottom end of the band is due to the lower limit of your SA. Sure the close in Phase noise of an "affordable" SA local oscillator is not going to be anything to write home about, but I doubt its as bad as seen in the sweep - I think much of what your seeing is really the SNR of the CPC.


For sure the HF noise is due to the lack of Ground plane, decent PSU decoupling etc. If I had spare time on my hands I'd love to redesign the PCB for improved video / audio :) With modern Hi-bandwidth LCD monitors you can see a lot of noise on the CPC's RGB output - even with the HF BW limiting filter capacitors fitted...

Its not in anyway a criticism of the CPC :) , its just the reality of 30 years of engineering progress in consumer grade electronics...
« Last Edit: 07:58, 02 May 21 by RetroCPC »