News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu
avatar_RetroCPC

Gilding the DKTronics Speech Synthesizer

Started by RetroCPC, 09:09, 24 May 20

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

RetroCPC

Harking back to my teenage years with nostalgia I have very fond memory's of my heavily modified Green screen CPC 464 system :)

IMO this as an era when you could really have fun playing and programming computers - nowdays computers are so sophisticated they are nothing more then a closed "Black Boxes" no FUN!

I ordered a non working CPC6128 from Ebay which is making is way to me from the UK, also from Ebay I found a DKTronics Speech Synthesizer being sold as ZXSpectrum stereo speaker system!

In the Ebay listing I noted that the "ZXSpectrum stereo speaker system" had a DKTronics CPC style housing and the Expansion Connector was key'ed CPC style so I took a chance and purchased the unit (complete with the matching speakers).

So currently I dont have a CPC, but I do have a Speech Synthesizer for it :)

JUST FOR FUN, I wounder how far the design can be Gilded - yes I'm aware of the FPGA implementations... but I lack the skills to program FPGA's so I'll just keep to designing the ultimate SP0256 based Speech Synth - for no other reason then for fun, and that I can :)

I find it helps to "Step back" from ones daily projects and work on something completely different :) opens the mind to look at things from different angles :)

So first step is to trace out the schematic - I have it on paper now, and will publish here once I've fully drawn it up in CAD.

PCB's "Marked AM. V2 Speech - dk 1084 RJG", so I guess "RJG" is the designer - or atleast the PCB designer...


I started with simulating the "Analogue stage" and Low Pass Filter.

Its credit to the original DKTronics designer that the filter while simple  (A Sallen-Key LPF based around a single transistor EF stage) the LPF (Low Pas Filter) corner frequency is set at 1KHz, with -20.7db Attenuation at 5KHz (Which I understand is the FS/2 point of the SP0256 PWM output).

I'd post the LPF Schematics / Frequency response simulations here, but it seems I cannot directly upload image files onto this Forum..

Next step will be to perform some real measurements on the hardware once my CPC arrives and is up and running... Be interesting to see the noise measurements - I recall hearing system noises thorough the speakers as the CPU was processing - and the speech had birdy type background noise. - a sign of significant unwanted  modulation via PSU / Clock etc.

VintageAdvantage

#1
The intended filter for the SP0256-AL you will find in the datasheet section, see Application Notes. It contains a reference design.
And it sounds crap. To MY ear, the filter is way too low pass... it cuts out almost all higher frequencies giving it a very monotone dull sound. It sounds MUCH better and more crisp with a MUCH HIGHER cutoff frequency. You really need to experiment with the real thing and play with the filter values in order to get something that sounds good.


Remember the Amiga 500? That thing also had a low pass filter... and the first thing everybody did was disable that filter or at least put a switch in. Better to have a bit of sampling noise than that dull low lo-fi bassy sound.

RetroCPC

#2
Todays the day my CPC should arrive from the UK :) Once its here I'll need to repair it, then face the challenge of how connect the CPC to an LCD monitor.

Also I'll need away to get Data to it!!! maybe WAV file via cassette port then save to FDD (if I manage to repair the drive, apparently the belt has been replaced, but its still not working so it might be a speed issue - or worst) - until I get a ROM board designed...

Once I the CPC working I can start to taking some measurements of the DKTronics design - I'm really fascinated to see the clock phase noise on the SPO's output. Its not going to be helped any that DKTronics cheapen out and used the system master clock rather then the recommend crystal and internal oscillator... While the SPO has a 7bit modulator, I suspect that the system clock phase noise will eat into this resolution!

My plan is to reclock the PWM output with a clean clock / PSU - does it make sense for a 7bit modulator / speech synth? who knows, and that's the "Fun" part to me... nothing sensible at ALL! :D

WRT the audio B/W, from what I understand (bare in mind I've not had a chance to measure the outputs yet) - the output sampling rate is 10KHz, so I need some form of brick wall filter at 5KHz...

VintageAdvantage

#3
It sounds better if you choose the cutoff frequency at 18 kHz.
YES, the effect of the 4 MHz instead of the 3.14 Mhz is that the pitch is higher, and the phonemes do not come out as intended. That is indeed an audible difference, whereas the other effects are more like reading the future from the tea leaves IMHO.
None of this will change the quality of the speech output quality. Filter and clock frequency make a difference though.

EDIT: Here is an idea - how about making the cutoff frequency of the filter variable?

RetroCPC

#4
To prevent aliasing products you need a brickwall filter at FS/2, if FS is 10KHz, then we need a brickwall LPF at 5KHz - thats going to be "Fun"

If the sampling rate (FS) is 10KHz, then there is no usable "Information" above 5KHz...

BTW, created a Dropbox account so I can post links for the Schematics etc.

Heres the simulation schematic of the DKTronics stock LPF:-

https://www.dropbox.com/s/93trqol4yk9rg4d/dktronics%20cpc%20speech%20synth%20lpf%20%20%20section.jpg?dl=0

The schematic is drawn up to allow me to simulate the filter - to this end, the schematic has extra simulation "Components" to model the output impedance of the SP0256's PWM output pin, L / R Balance and Volume potentiometers & the input impedance of the LM386's. Some of these components are not physically present on the PCB but internal to the respective IC's.

Whats not modeled is the effect of looping though the CPC's Stereo Audio output via the flying lead / 3.5mm Audio jack

Resultant frequency response:-

https://www.dropbox.com/s/jef1p52yt5yaw3p/dktronics%20cpc%20speech%20synth%20sim.jpg?dl=0

VintageAdvantage

#5
Quote from: RetroCPC on 06:51, 26 May 20
To prevent aliasing products you need to have a brickwall filter at FS/2, if FS is 10KHz, then we need a brickwall LPF at 5KHz - thats going to be "Fun"

If the sampling rate (FS) is 10KHz, then there is no usable "Information" above 5KHz...


We all learned about Shannon's Samplng Theorem in High School, but that's not the point. It just doesn't sound good if you do it that way. You really need to listen to it... your simulations are misleading. If you really want to create something that sound BETTER than the original you will actually have to leave the realm of simulations and listen to it. And hand tune the filters.


It is exactly these "sampling artifacts" above 10 kHz that brings the thing alive.  Every violin maker will tell you that.

RetroCPC

#6
Well is seems that we can both agree that NOS (well more correctly non filtered) DAC's sound better then DAC's with sharp FIR digital filters - I wonder how bad an analog brickwall sounds...

I'd be cautious of what others refer to as "Sampling noise" its my experience that they are infact forced to reduce the Audio bandwidth to help filter System / Clock / PSU noise rather then noise due to the limited sampling bitdepth & BW...

I have no recent experience of such a limited bit depth sampling (8bits) in the case of Amdrum, so I'm somewhat curious as to how it will sound once these unwanted modulation effects (PSU noise / Clock jitter modulation etc) are eliminated.

As a side note, actually I had an extremely poor education, and never learnt about Shannon's Sampling Theorem at High School... :)

Bryce

In many places it's referred to as Nyquist sampling theorem. You may have learnt about it under that name?

Bryce.

Gryzor

I now realise my high school sucked. Not only did we never learn about Nyquist*, but they also shut down the school's reactor before we had a chance to make it go boom.

*hey, at least I got to read about it today, interesting indeed.

RetroCPC

#9
Quote from: Bryce on 09:15, 26 May 20
In many places it's referred to as Nyquist sampling theorem. You may have learnt about it under that name?

Bryce.

I'm fully are of Nyquist - Shannon Sampling Theorem :)

But for sure it was not taught at my "High School" - if others did at high school, then it just confirms once again how bad my education experience was!

RetroCPC

#10
Quote from: Gryzor on 09:53, 26 May 20
I now realise my high school sucked. Not only did we never learn about Nyquist.....

Your not alone !!! :)

RetroCPC

#11
Seems I was also not taught how to use forums correctly, I've just discovered the method to directly upload image files etc :)


Bryce

I have a real DKTronics Speech Synth (the ROM version) and a spectrum analyser with tracking generator. So if you want me to do any real world analysis let me know and I'll try to find some time for it. Those simulation results look pretty realistic though, I can't imagine the real device will vary much from those values.

Bryce.

RetroCPC

#13
10% resistors & ceramic caps in the LPF fc  is going to be "Loose"  :laugh:  but whats going to impact the audio performance will be the Clock Jitter /PN - especially as the SP0256 is clocked directly from the System Bus clock...

I suspect the Clock PN will be so high that it will be well within the dynamic range of most spectrum analyzers - - I 'd hazard a guess with non clock related spurie say -40dB down..  (I'd not be surprised if its even worst) What would you guess?

The Clock PN is never going to be better then the noise on your PSU rails... trying to improve the clock performance without first improving the PSU is going to be kind of academic ....

In many ways, this is a good teaching aid to demonstrate the ill effects of PSU / poor clock distribution etc... but this is not to take anything away from what was expected at this price point in its time. Ok, so the Amstrad Speech Synth implemented local 3.12MHz Clock, but its just going to be modulated by PSU AM noise so while it will have better performance, its still going to be pretty poor.

I recall how one could listen to the CPC CPU processing via the background noise of its internal speaker... :) The the AY sound chip is clocked by the ASIC which divides down the 16MHz System clock to 1MHz - just for fun I will to perform a spectrograph on the AY Sound Chip clock input to see how much of the CPU processing action we can see on the clock noise floor... :)  - what would be a good guess? noise floor @ -40dB to -50dB down?

I remember a magazine once published a program to generate sound from your ZX81 by tuning a radio to a certain frequency and performing program loop routines to play "Music" in the radios background noise!!!

Today's generation have no compensation of how much computers / digital electronics have developed in the past 40 years!!!

Bryce

To be fair to the developers back then, they were most likely under serious pressure to design down to a price, so they would have been given only a few cents above the price of the essentials (Case, SPO and connectors) to get the rest done. Considering those restraints, they did a great job.

Bryce.

RetroCPC

Quote from: Bryce on 14:07, 26 May 20
To be fair to the developers back then, they were most likely under serious pressure to design down to a price, so they would have been given only a few cents above the price of the essentials (Case, SPO and connectors) to get the rest done. Considering those restraints, they did a great job.

Bryce.


Yes for sure, I wasnt being critical of the designers, in fact you have to admire building a Sallen-Key LPF around a single Emitter follower transistor - reminds me of those 5 transistor "Walkie Talkies" we had as kids, designed around 5 or 6 transistors for TX & RX + Morse key :) claim 5 mile range - yet you where lucky if they worked over 100m :D

Crazy that they (everyone was the same at the time) costed down so much when the cost would have been in the molded case, PCB, connectors + SP0256... kind of a false narrative to then save penny's on a crystal / ceramic resonator...

Bryce

Quote from: RetroCPC on 14:27, 26 May 20

Yes for sure, I wasnt being critical of the designers, in fact you have to admire building a Sallen-Key LPF around a single Emitter follower transistor - reminds me of those 5 transistor "Walkie Talkies" we had as kids, designed around 5 or 6 transistors for TX & RX + Morse key :) claim 5 mile range - yet you where lucky if they worked over 100m :D

Crazy that they (everyone was the same at the time) costed down so much when the cost would have been in the molded case, PCB, connectors + SP0256... kind of a false narrative to then save penny's on a crystal / ceramic resonator...

You mean those walkie talkies whose range was battery-level dependent and drifted all over the radio spectrum? :D Had one too. Our TV screen went white if you pushed the talk key in the living room.


Bryce.

Gryzor

Quote from: Bryce on 14:36, 26 May 20Our TV screen went white if you pushed the talk key in the living room.

It just triggered your resident Poltergeist.

Bryce

I got in serious trouble for this once, when my father was recording a film he wanted to see and I inadvertantly caused a large part of the recording to be white.

Bryce.

RetroCPC

#19
So my CPC6128 arrived - and there's a 95% chance that its original owner has since died of lung Cancer - and to add to the seriously strong smell of nicotine the unit has been stored in a damp cellar or some such... A really NICE combination..

Oh - and to add to this, at sometime in its life it looks like coffee has been spilled over the keyboard...

I've stripped the unit down, PCB's is in good condition (an unbelievable amount of old solder flux on the underside of the board) - I'll rinse it under water to remove the top layer of dust and grime, then drop the whole PCB into an ultrasonic cleaning tank...

I'm now so jealous of those of you with with show grade units :) all I can say is that my room now stinks like an rotten smokey old pub... at this rate I might have to start worry about my own lungs!!!

A quick question, can the CPC6128 read PCW256 CPM disk or will it result in a disk error? The gentleman I purchased the unit from said he replaced the FDD drive belt, but it still did not read disks - however the disks he sent with the unit are apparently from a PCW256... so maybe the drive works, but the disks are formatted differently?

If its not the fact that the disks are CPM disk format, then I also noticed that the FDD drive motor does not spin as freely as I would expect - its rotation seems stiffer then you'd normally encounter with such sized DC motors ... are sticky Drive FDD motors a known issue with the CPC? The Motor is still connected to the PCB so maybe theirs some electric braking (via diodes or some such) even when the drive is unpowered?

Bryce

Nothing that 10 litres of isopropanol can't solve!

As for the disks, not a chance, PCW disks are double sided and the CPC drive only has one head. If you install a dual head drive as B, then you can use ParaDOS to read them. As far as the drive itself is concerned, remove the belt and check that all the gunk from the old belt was removed from the wheels. The motor turns at 300 RPM, so it should sound differnt to PC floppy drives. Grab some original disk from someone here or ebay and then give it a test. If it still doesn't read, then let me know and I can give you some tips on getting it working.

Bryce.





RetroCPC

#21
Bryce,

Thank you for the reply - WRT your suggestion of isopropanol, is that to clean the unit of the nicotine / damp smell?

I have an ultra sonic tank that will clean the PCB, I'll first dissolve the old flux with isopropanol - I find isopropanol just dissolves the flux residue into a thin sticky film that coats the PCB, it then needs to be cleaned off somehow and the best cleaner I've found is SWA Flux foam cleaner from Electrolube.

VintageAdvantage

#22
This is what the original designers thought the filter should look like.
I'd be interested in seeing the results of this compared to the filter you are designing (simulation runs).



VintageAdvantage

#23
Quote from: Bryce on 14:07, 26 May 20
To be fair to the developers back then, they were most likely under serious pressure to design down to a price, so they would have been given only a few cents above the price of the essentials (Case, SPO and connectors) to get the rest done. Considering those restraints, they did a great job.
Come on... the developers used the reference designs already provided by GI for the SP0 and figured out how to make a simple transistor amplifier. That's 101 electronics, even in the 70s. I don't think that took them more than 3 days...

IMHO most of the work is in the software, today and even back then. See, the hardware of the whole CPC was thrown together in a couple of weeks. They even threw away the intial 6502 design and switched to the Z80 because they wouldn't have been able to meet their deadlines otherwise, given the availabilty of the Z80 BASIC...

Most of the development labor went into the RSX extension for the DKtronics for sure, not the (simple) hardware.

I think they did a great job, but it is really not an engineering miracle that was produced under extreme pressure or whatever. It is a standard design that every 2nd semester EE student should be able to accomplish in 3 days.

RetroCPC

#24
Quote from: VintageAdvantage on 01:35, 27 May 20
This is what the original designers thought the filter should look like.
I'd be interested in seeing the results of this compared to the filter you are designing (simulation runs).


Sorry for the delay in getting back to you - I'm self-teaching myself C++ and all I can say is that I feel REALLY REALLY dumb...

Anyway, took some time out to give my mind a rest from C++ and sim'ed the SP0256 Datasheet LPF - and WOW it rolls off really early, with the -3dB point at just 336Hz, its -12dB at 1KHz and -36dB at 5KHz!!!

Makes the DKTronics LPF look positively HiRES by comparison :D

Attached is the Sim result + schematic just in case I made a stupid error with a component value...

Powered by SMFPacks Menu Editor Mod