Golborne Vintage Radio

Full Version: FPGA System A modulator
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6
I have started trying build a system A modulator within a FPGA and this is as far as I have got. I am using a EP4CE10 Cyclone IV FPGA and a AD9744 DAC chip. The DTO clock frequency is pixel frequency X 20 = 174.96 MHz.

The AD9744 that I received from a reputable source was faulty. It has a differential output and one side is completely dead. I had thought that because one side was down the other wouldn't work either but there is a sensible output from the other side which I am using.

All the photos below is of a 51.75 MHz carrier.  The first photo is the output of the DAC and the second is after feeding it through a low pass filter. The filter is a C-L-C-L-C Butterworth with a cutoff frequency of around 70 MHz.  The next is it modulated with a grey scale and then Test card C. Test card C looks a lot worse in the photo that it actually is.

It works OK'ish but it's dirty or slightly foggy looking, not as crisp as it should be.
The last photo is of the unmodulated carrier with the trigger control carefully adjusted it can be seen that the carrier's amplitude is not stable and I believe that it is this that is causing the fogginess.

Frank
Wow! What a brilliant result. The actual VHDL code for a modulator isn't very complex but actually doing it and getting such great looking results is a significant achievement.

The actual modulator code need be no more than:
MODULATED_OUTPUT <= UPSAMPLED_VIDEO * CARRIER;

This may not be fast enough as the inferred multiplier may need pipeline stages. Sometimes these can be inferred from the VHDL, otherwise you need to create a multiplier core and instantiate it. Frank already has experience of upsampling video by smaller factors in Hedghog so I would hope that the larger factor (x20) holds no terrors. The clock management in modern FPGAs makes generating the high clock frequency pretty easy. Might be easiest to start with the high frequency and divide down to pixel clock rather than the other way round.

Carrier generation is a DTO and sine table. Nothing too hard but it's got to run pretty fast. The raw carrier waveform will likely not be a very pure sine wave. Unless the LPF is perfect, even with a factor of about 3 between sample rate and output frequency there will be visible irregularities. I don't think this matters. If you want to investigate the subject in more detail scale frequencies down by a factor of 10 or whatever so you aren't pushing your scope too hard and possibly getting secondary effects.

What sort of output circuit have you got after the DAC? I would strongly recommend that you use both +ve and -ve outputs with a small transformer to do balanced to unbalanced. The transformer need be no more than a small ferrite "8" core or ring.
Hi Jeffrey
Thank you, I was surprised how well the carrier looked after the low pass filter.
You are right I did start with the higher clock frequency and then divided it down for the pixel frequency. Reading back I can see that what I wrote inferred the other way round.

I am using a multiplier core for the modulation 9 bit video and 14 bit carrier with the output truncated to 14 bits. Also just doing X 4 oversampling for now will do X 20 later.

The output circuit of the DAC at the moment is unbalanced just using the working -ve output.  I have another AD9744 (hope it is not duff too). I will fit it and try the balanced to unbalanced circuit you suggested.

Some not so good photos of the board I am using.

Frank
Now this project looks very interesting Frank, your ingenuity amazes me.
Hi Frank.
Amazing work yet again. You are a lucky man to get the time to do all this and have the skills to do it as well, I take my hat off to you.
I wonder if the DAC will be sufficiently linear to do sound and vision without excessive intermodulation. Looking at the specs I feel it ought to be but I'm not an expert on RF.

The audio will need to be converted by an ADC, then upsampled by a huge factor before multiplying by the audio carrier. The audio and video modulated carriers are then simply added before being applied to the DAC.

For test purposes one could easily generate some tones to modulate the audio carrier. This would allow simple tests for intermodulation.
Just realised that the audio modulation is slightly more complex than the video. In the absence of modulation, the carrier in an AM signal isn't zero, it's a finite value. When the audio swings +ve the output of the modulator rises, when it swings -ve the output falls. Falls to zero at 100% modulation.

Hence:

Modulated_audio <= (k + Audio) * Carrier;

where k i s a constant equal to half the p-p audio amplitude.
Hi Stephen and Trevor.
Thank you both.

Hi Jeffrey
How to implement audio modulator had me stumped for a while. As you have said getting the correct carrier level was the problem. An amplifier is required  to amplify the incoming audio to close to 3.3 V to get the full range out of the ADC. I have used an TS971 op amp for this purpose. It's output is DC coupled to the input of the ADC. The Quiescent voltage at the opamp's output will set the audio carrier level. So by biasing it so that it is at half rail voltage should set the audio carrier to be 6 dB down on peak white. Well that's the theory anyways but it has to be tested yet!

The video levels at present are not ideal for the modulator. They are (peak white) 216 + (sync) 92 = (total) 308. Scaling the values to have a total of 512 would be much better and might improve the the signal to noise. The scaling  probably can be done within the oversampler but I will have to think about that a little more.

Frank
Video scaling is probably best done before or after the oversampler. Only needs a multiplier and adder. Also good idea to have a limiter so you can't accidentally go from 511 round to 0 or vice versa.

For audio decide on what digital range represents full modulation. Let's say it's 16 bit audio with a potential range of 0-65535. If we say that 32768 represents zero audio then 0 and 65535 are maximum possible excursions. Then using a multiplier and adder as required get the modulator to give the required output, 6dB below vision. Best to experiment by generating a full scale audio tone at carrier sample rate. Easily done with a DTO and sine table. Then you can easily see the modulated carrier on a scope.

The only purpose of the gain control before the ADC is to match the analogue audio amplitude to the ADC's input range. You really want AC coupling somewhere so that zero audio will map to 32768 regardless of the gain setting. I think you will find this easier if you use an ADC that's designed for audio, rather than the general purpose ADC you're currently using.

In practice you never want to utilise full 100% modualation as it will cause the detectors in receivers to distort. In practice you set up the gain control until it distorts and then back it off a bit.
Further thoughts.

If you're combining vision and sound digitally then the total of the 2 of them mustn't exceed the DAC's range. It's a 14 bit DAC so the total range is 0-16383. Without doing the sums properly I think you could use half of that for vision, leaving the other half for sound. Although unmodulated vision carrier is 6dB below peak white, at 100% mod the peaks would be equal to peak white.

Hence the vision levels would be 0 for sync tip and 8191 for peak white. The unmod sound carrier would be 4096 p-p. Add them together to get the final result.

I admit I haven't sat down with pencila nd paper to do the sums properly and it would be a good idea to do so. However, it's easy to play with the parameters in a FPGA so if you get it wrong it's no problem.
Pages: 1 2 3 4 5 6