Hello all,
I have a frequency modulated signal. I would like to determine each period of the FM signal, then determine whether it is above or below a reference period. Based on that decision I would like to either multiply this period with a constant factor or divide by it. Having done that I want to generate a new signal based on the determined periods.
In summary, I would like to amplify the frequency modulation of a FM signal by either increasing or decreasing each period.
I am not even sure whether this can be done with a real circuit. But, at the moment I want to use VerilogA to implement the above.
The period determination and scaling is not an issue. I was wondering how I can create a new signal based on the obtained period information. I guess I need to create 1 period of this new signal, and then add on another just determined new period.
Can anyone suggest a way?
Regards,
Sven
I am using the following code to determine the periods of a FM signal.
Code:`include "disciplines.vams"
`include "constants.vams"
module fmeasure (in, out);
input in; voltage in;
output out; voltage out;
real last_time, current_time, freq;
analog begin
@(initial_step)begin
last_time = 0.0;
freq = 0.0;
end
@(cross(V(in) -0.5, 1)) begin
current_time = $abstime;
if (last_time > 0.0)
freq = 1.0 / (current_time - last_time);
last_time = current_time;
end
V(out) <+ freq;
end
endmodule