Costas Loop

Hi All ,

I am new to Digital comms and I am learning to implement costas loop in software. I have read a lot of theory and I am using a DSP library to implement Costas loop. I have a NCO that take the an error output from a loop filter whose alpha is configurable. I also have two LPF for the two arms. The system works when the symbol rate is 400bps and the center frequency is 1200 hz BPSK . When I changed the bit rate to

100bps and 3Khz (around 30 cycles per symbol) carrier it takes a ~160 bits to achieve synchornisation.

From the above experimentation I can see that synchronisation time increased with cycles per symbol. Why is this ? what are the parameters in a costas loop that can be adjusted to reduce synchronisation time.

BR Rate

Reply to
ratemonotonic
Loading thread data ...

Notes on writing clear posts:

Complete citations are helpful. "So and so's 'XYZ' brand of digital signal processing library's 'Simple Simon' Costas loop'" is better than "some software".

Don't assume the respondents are omniscient. Even after you fully cite your obscure software, don't assume that everyone will know how it defines a named parameter like 'alpha'.

Don't assume that all implementations of a technology are identical. One author's (or software vendor's) "alpha" may be someone else's "k_a", or may only show up as a combination of everyone else's parameters. So say what it really is if you know, and if you don't say "it has this here parameter called 'alpha' that I don't understand".

Don't give one-sided comparisons. Political candidates give one-sided comparisons because they don't know how to think, or they know that the electorate is too lazy to do so. Engineers _always_ compare A to B. Saying "B takes 160 cycles to settle" without saying how many cycles A takes to settle is a waste of bandwidth and my time.

I'll do my best to answer what appears to be your question in a separate post.

--
Tim Wescott
Control systems and communications consulting
http://www.wescottdesign.com

Need to learn how to apply control theory in your embedded system?
"Applied Control Theory for Embedded Systems" by Tim Wescott
Elsevier/Newnes, http://www.wescottdesign.com/actfes/actfes.html
Reply to
Tim Wescott

Costas loop is a basic thing which takes 5 lines of code. IMO those libraries are the entities beyond necessity, and they only create lots of clutter, additional restrictions and complexities.

Did you calculate the loop filter parameters properly?

That's very slow. The BPSK should catch up in 1..2 dozen of BPSK bits, unless the SNR is marginally low and/or there is a huge frequency offset.

Unoptimal parameters of the loop.

Costas loop can be considered as PI servo; all that applies to PI regulator applies to it also.

Vladimir Vassilevsky DSP and Mixed Signal Design Consultant

formatting link

Reply to
Vladimir Vassilevsky

Tim,

The points you made are excellent. You have my sincere respect.

VLV

Reply to
Vladimir Vassilevsky

I assume that your 160 bits to achieve sync is more than what you were getting in the 400 baud case, but I don't know because you don't say.

First, foremost, and always: If you can't do it yourself, and if 9 million other folks aren't doing it too, then using some crummy software package to do the work for you is going to lead to disaster. So I suggest you learn how a Costas loop really works -- then take shortcuts by using software.

I have no clue of the details of your particular implementation of the Costas loop. I suspect that this 'alpha' parameter is either a generic bandwidth setting, or a generic overall gain setting, but that's it. Given the same noise levels in both cases, and ignoring aliasing due to low carrier/baud ratios, you should be able to make your loops settle in the same number of symbols in either case _if_ you jigger the gains in your Costas loop appropriately. But knowing that "appropriately" requires understanding the Costas loop _and_ the implementation of it that you're working with. From your question, you need to work on both of these areas.

I'd suggest that you at least figure out what the parameters of the algorithm are supposed to do, and post the software vendor's description of them, and a better description of your problem ("A is, and B is 160", doesn't cut it).

--
Tim Wescott
Control systems and communications consulting
http://www.wescottdesign.com

Need to learn how to apply control theory in your embedded system?
"Applied Control Theory for Embedded Systems" by Tim Wescott
Elsevier/Newnes, http://www.wescottdesign.com/actfes/actfes.html
Reply to
Tim Wescott

I don't know if the OP is getting his software from MatLab, but it seems that the folks over at the MathWorks want to have a canned solution for everything.

Like reheating frozen food, the quality of software from a box depends heavily on what you start with. Reheated frozen enchilada dinners from a box are easy, way better than what you can make without a lot of work, and may be better than you can make ever. A boxed OS is easy to use, way better than you can make without a lot of work, and may be better than you can make, ever. Reheated frozen lettuce would be a disaster, and a Costas loop from a box...

-- snip --

With a few complications thrown in, absolutely. If you understand closed- loop regulation and you understand the effects of the Costas-style phase detection, then you should know how to adjust your parameters.

--
Tim Wescott
Control systems and communications consulting
http://www.wescottdesign.com

Need to learn how to apply control theory in your embedded system?
"Applied Control Theory for Embedded Systems" by Tim Wescott
Elsevier/Newnes, http://www.wescottdesign.com/actfes/actfes.html
Reply to
Tim Wescott

Recently somebody was asking here how to convert Matlab to C. He only needed the matrix multiplication, huh.

If you know how to make an amplifier from transistors, you can build it using an opamp IC as well. But if you have no clue of how the amps are made from transistors, the off the shelf opamp is not going to help. Costas loop from the box is not the solution of a problem, but just a component like IC.

Vladimir Vassilevsky DSP and Mixed Signal Design Consultant

formatting link

Reply to
Vladimir Vassilevsky

There's a feeling of a student trying to get the project work go by without touching the grey matter inside his/her head. It has the symptoms of an active attempt to avoid learning.

--

Tauno Voipio
tauno voipio (at) iki fi
Reply to
Tauno Voipio

I call them stupidents. Or studiots.

VLV

Reply to
Vladimir Vassilevsky

Hi all ,

Sorry for the late response to this I was busy reading up. The problem was not synchronisation time but phase reversal. The problem was that costas loop is blind to 180 degree ambiguity. Running some more simulations it became clear. I implemented differential encoding to get around the problem. Enjoying learning this fascinating field.

BR Rate

Reply to
ratemonotonic

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.