simple IQ-Modulation with cordic(finished)
Reinhard
Posts: 489
Before I get the silicon (thanks to Connecticut)
I can think of a few more theoretical thought experiments.
How about an IQ modulator?
As you know, the equation is
f_sig_out = f_sig_in * cos (f_carrier) + f_sig_in * sin (f_carrier)
This means if an input signal is modulated without a DC component
a frequency spectrum is created with f_carrier + - f_sig_in.
With the DC component, f_carrier - f_sig_in, f_carrier, f_carrier + f_sig_in is created.
Only DC input, no AC, creates f_carrier.
I simulated exactly this case with the help of the Cordic solver.
One can do without the two multiplications if the
qrotate statement with which input is scaled.
I can think of a few more theoretical thought experiments.
How about an IQ modulator?
As you know, the equation is
f_sig_out = f_sig_in * cos (f_carrier) + f_sig_in * sin (f_carrier)
This means if an input signal is modulated without a DC component
a frequency spectrum is created with f_carrier + - f_sig_in.
With the DC component, f_carrier - f_sig_in, f_carrier, f_carrier + f_sig_in is created.
Only DC input, no AC, creates f_carrier.
I simulated exactly this case with the help of the Cordic solver.
One can do without the two multiplications if the
qrotate statement with which input is scaled.
dat org 0 mov angle,#0 mov sig_in,#100 'DC constant loop mov sig_out,#0 'clear output qrotate sig_in,angle getqx x 'x = sig_in * cos(angle) getqy y 'y = sig_in * sin(angle) add sig_out,x add sig_out,y 'sig_out = x + y add angle,##$800_0000 'increment 11,25° jmp #loop x res 1 y res 1 angle res 1 sig_in res 1 sig_out res 1
Comments
I actually got the 1024-point FFT running in under 1ms, but I want to spend more time later making it work by self-modifying code, so that it takes way less space.
But I have no experience in compiler construction.
I am an electrical engineer, not a computer scientist.
I have some experience in assembler programming in my professional life,
(PIC's), lots of knowledge of C and math.
I would also like the P2 to be given more attention in Germany.
so if German speakers are present here, maybe we can do something
to launch ?
I can only say that I respect the 1024-FFT !
Reinhard
This is a big advantage over other DSPs.
I see a few limitations:
8 bit output
Q output only
output to DAC or digital pins? only
no way to reset phase (perhaps this could be worked around by running at a very low frequency and stopping it at a certain phase)
None of this matters for an RF modulator. Except maybe the 8 bits.
It only outputs to the DAC channels.
The only way to reset its phase is to disable and reenable it.
I logged the output of the simulation and entered a scilab script.
The result corresponds to the theory.
sig*sin(ct) + sig*cos(ct)
sig*( sin(ct) + cos(ct) )
sig*sqrt(2)*cos( ct - pi/4 )
Thanks, Chip.
That is still an improvement over the P1, which had no way to reset the chroma phase.
a) sig*sin(ct) + sig*cos(ct)
b) sig*( sin(ct) + cos(ct) )
c) sig*sqrt(2)*cos( ct - pi/4 )
Yes, it show the principe of double sideband modulation with suppressing carrier.
if we say sig = cos(phi) and ct = (20*phi)
we get sig_out = cos(phi) * cos(20*phi) + cos(phi) * sin(20*phi)
this is the a formula for double sideband modulation and corresponds with your equation a)
b) and c) are alternative forms.
Another alternative form is 0.5(sin(19*phi) + sin(21*phi) + cos(19*phi) + cos(21*phi))
Here ws see the sum and diffs in frequency domain, the carrier is suppressed.
If I get my ev board, I make a physical signal.
Reinhard
P.S. I am back in the forum after new year.
At the beginning of the 90's I was working in a company in germany. The CEO was an American. In the 1960s he acquired the monopoly of transmitting background music to shops and hotels via telephone lines, (muzak) .In the 1990s he terminated the lines and rented a transponder on a semi-commercial satellite. (Kopernikus3).
But the signal had to be encrypted. At that time, digital processing was not yet available cheaply. In the course of my thesis, I developed an analog scrambler. The band-limited audio signal was modulated up and down again.
The upper sideband is cut and what is left is a frequency shifted and sideband inverted audio spectrum. This process was reversed in the receivers and the plain signal was audible. An entire European board was required for the analog components. Now I want to do a retro development with a chip for fun. I think this is easy for P2.
Back to the thread:
For the first one, I connected an external 8-bit R2R DAC because I just have it in my handicrafts. I don't want to be able to output it on a smartpin yet. I'm probably doing something wrong. I copied templates from the P2 Audio Out thread, but the pin remains silent. It would be great if someone could help me with a code snippet.
something is comment out in the code, for debug reasons.
The reason for use the old R2R dac is, because I haven't Experience with smartpin handling.
Today I receive my EV Board and I wanted to see a quick success. Connect Osci to the pin and look at the signal.
But I don't see anything with the output to smartpin. The pin is at 0Volt. Or do I still need a resistor on the pin?
smartConfigAudioDAC from the snippets of thread P2 Audio Out was not defined.
I thought that's ok,but maybe not.
The DAC output is what I want for first and what I expected.
A Happy And Succesfull New Year To All The Listeners!
Muzak, long long time ago.
I was from 1991 to 1993 in the company.
In Germany/Austria the was called funktionelle musik gmbh.
It was an exciting and interesting time.
Happy New Year.
I trimmed the sig_in frequency to 1kHz, the local oscillator frq. to 20kHz.
The sig_out has 19 and 21 kHz frequncy components.
the time domain looks: