Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

How to differentiate 2 frequency from serial line?

Status
Not open for further replies.

xtcx

Advanced Member level 1
Joined
Dec 22, 2007
Messages
493
Helped
65
Reputation
130
Reaction score
58
Trophy points
1,308
Location
Bangalore, India
Activity points
5,003
Hi friends!, I'm trying to decode FSK waveforms in a receiver using FPGA. At curr norm, I use "125MHz" DAC, but is clock at 40MHz only inorder to give 2 & 4 MHz sine at 20/10 samples. This is for the compatibility of 40MHz adc in RX module.
Data Rate = 2MHz,
F1 = 2MHz(20 samples for sine) 40MHz/20 sa => 2MHz
F2 = 4MHz(10 samples for sine).40MHz/10 sa => 4MHz
I switch these two signals according to digital date.This is done in Tx unit. F1 represents '0's and F2 represents '1's.

I sample this fsk signal(in Rx unit) through 40MHz ADC so that I can get a max of 20 Samples and 10 samples for these two sine respectively. Now that I have collected the data stream. I need to identify these two sine waves of (f1,f2) from data stream of adc output so that I can get my coded data back. I'm hung up with this!. Could any of you guys suggest me any solution for differentiating these two analog signals?. Also I tried this, like I generated two square waves from the adc data which are exactly of same frequency with respect to those two analog sine (f1,f2) resp.

Sqr_wave1 = 2MHz
Sqr_wave2 = 4MHz
Sqrwave(f1,f2) <==> Sinewave(f1,f2)
But I don't know any idea of differentiating these two square waves. I must differentiate the two freq inorder to get the data. All I need is the concept\idea of how to recover 1s and 0s from these two frequency "sine\sqr waves" whichever is easier for programming.I do not need any code. So whomever reads or has information or idea,please just suggest here. Your suggetion could be a solution. Thanks a lot!
 

Hello friend,

See if this can help you....

code two counters clocked by higher frequency(4 Mhz or higher)
use the input frequency(FSK ) signal as a count enable signal
and check the value of the counter.
it should be double for 4MHz signal as compared to 2 Mhz signal.
Let me know if this helps....
 

    xtcx

    Points: 2
    Helpful Answer Positive Rating
Hello,

to my opinion, decoding of an ideal FM signal shouldn't be a problem at all. It can be reduced to simple frequency respectively period intervall measurement, as suggested in the previous post. In this case, i see no particular purpose of using a sine rather than a squarewave signal at the transmitter.

I guess, the a sinewave carrier is used, cause the FM signal shall be transmitted by a channel. But how does the signal look at the receiver? Decoding of a noisy signal actually could be an issue, with low SNR (signal-to-noise ratio) even impossible with simple period measurement.

That's the point where digital receiver techniques come into play. There are many options, a general technique is using a digital PLL to track the carrier. With the intended f/2f FSK modulation, a special PLL construction could be used, that locks to both f and 2f (assuming the carrier phase is continous and not changing arbitrary).

Regards,
Frank
 

Thanks kvingle...First I will try out what you have tipped me....This seems to be a wonderful idea....I will post the results soon...And


FvM said:
There are many options, a general technique is using a digital PLL to track the carrier.

I'm supposed to restrict myself with FPGA, and currently they've not said anything about using PLL. I better try to bring every decoding options within FPGA,But if the necessity arrises,I will...Please tip me when that case approaches :D Thanks you two..
 

Hello,

a digital PLL in this regard would be only some FPGA code, including a NCO. If you receive analog signals through an ADC, downmixing with quadrature output NCO "local oscillator" (by multiplication) would be the appropiate digital receiver technique for maximum performance. But there may be simpler solutions for your application.

Regards,
Frank
 

kvingle said:
code two counters clocked by higher frequency(4 Mhz or higher)
use the input frequency(FSK ) signal as a count enable signal
and check the value of the counter.
Your concept seemed to work out when I simulated it in MOdelsim. But In realtime the timmings were very different. Like I setup the system clock of 40MHz and compared the two succesive ON-time pulses of the incomming signal to differentiate the frequency. The expected count value of the pulse 1 and pulse 2 are not always constant. Instead I used this method, like the frequency of the two incomming signal is fixed though might have slight oscillations.so I set up a range of values and compared the ON-time value with the pre-set value. If the value exceeds the pre-defined value, then the incomming pulse has a lower freq(since higher the counter value,longe the time). So I assign this as '1' and the other as '0'. Now I am able to recover the fsk signal. But the major drawback in this model is that the frequency of operation and the Tx-Rx rate must be constant dependant on the value of the pre-set.
For eg,
PROCESS(clk,ip_data) then
VARIABLE sqr,temp : INTEGER ;

IF risin_edge(clk) then
CASE ip_data IS
WHEN '1' => sqr := sqr+1;
temp := 1;
WHEN '0' =>
CASE temp Is
WHEN 1 => temp := 2;
IF(sqr >= 8 ) THEN
fsk_op <= '1';
ELSE
fsk_op <= '0';
END IF;
WHEN 2 => sqr :=0;
WHEN OTEHRS => NULL;
END CASE;
WHEN OTEHRS => NULL;
END CASE;
END IF;
In this sample program,like I did I check the counter value for every single frequency at the '0' position. Only ON time is being counted. The value for which sqr register is compared has been chosen from (clk time x ON-Time). This is how I worked out....If you find anything strange, may you indicate appropriately. I'm just a beginner.[/quote]

Added after 11 minutes:

FvM said:
Hello,
i see no particular purpose of using a sine rather than a squarewave signal at the transmitter. I guess, the a sinewave carrier is used, cause the FM signal shall be transmitted by a channel. But how does the signal look at the receiver?

We prefer sine wave as because it's how the fsk protocol of modulating and de-modulating a digital signal exists. Altogethor, the modulated op needs to be transmited in air via an RF medium, and hence a higher level modulation is always performed again in RF level. So I guess a sine wave is much prefered for reliability over longer distance. That's where digital modulation comes into play. Also receiving the sine wave and recovering it is easier since the sine wave is gonna only represent two state.My opinion couldbe fallible but is what I know....
 

From India....gr8!
Ok. Friend.Even I am not an expert in FSK comm.
I am just trying to check my digital reasoning.Its good that you are able to recover the FSK signal.the approach that you have used i.e. to decode '1' first is good to tackle with oscillation problem, still I am not sure how much efficient it will be..see SNR you are dealing with.
i think the problem of fixed tx, rx rate should not be
a major hurdle, you can define a fixed data exchange rate at both ends at the initialization stage.Same as what we do for UART communication and in fpga you can set a command word register to select proper constants.(What were you expecting a auto sync mechanism?)
And to deal with sync problem you can send sync data such as a sequence of 1's and 0's to sync Tx and Rx.(as they do in Ethernet)

let me know the progress..
 

Thanks!, But I ain't an expert either!....I just have started my career recently in VLSI. Anyhow, I'm not at the level of synchronization and error correction yet...I first gonna complete all possible types of modulations that are all possible in FPGA...At present I have completed ASK, FSK(now),PSK(mod only). I'll let you know the progress...It's a great place to share the knowledges I believe. I have one more doubt regarding the sine wave which I'll make it a new post. please see for it and suggest me...
Regards
Balan.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top