 # Frequency modulation in GRC

Hi,
I have made the flowgraph as attached…It is showing the modulation in
scope but in fft block it’s continuously changing so I am still unable
to
find out that what are the max and min frequencies??I know how to find
that
in theory but i want to prove it from my results…

Well, when I use the same sensitivity as u, I cant see, but with higher
value u can see.U can use average option but still with that sensitivity
u
will not see much.

I was experimenting with this the other day. I used
the wide band FM modulator instead, since the
deviation can be set. Here’s the flow graph.

http://www.w6rz.net/fmtest.grc

The test audio files. sine01.wav is 0.1 Hz and
sine15k.wav is 15000 Hz.

http://www.w6rz.net/sine01.wav

http://www.w6rz.net/sine15k.wav

Some C code to generate audio files at other frequencies.

http://www.w6rz.net/sine.c

Ron

Another question related to my flowgraph that when i use the’ Frequency
Mod’ block…then it will take the center frequency as 50Hz(the freq of
the
signal coming in)??

Correction not 50 Hz but whatever the rate is after interpolation

Ali,

again: there is no center frequency in a baseband simulation. Your
sawtooth-repeat combination will give you a step signal, where the
amplitude is constant for 500 items. All frequencies that you set are
only used to calculate what will happen in one sample.

The frequency mod is but an input amplitude controlled complex sine.
It outputs a signal, which has a momentary phase increase that is
proportional to sensitivity and input amplitude; see the doxygen
documentation for the frequency_modulator block.

Greetings,
Marcus

You still seem to have no real grasp on what the frequency_modulator
block does.
Read my reply, and the documentation to that block again:

The frequency mod is but an input amplitude controlled complex sine.
It outputs a signal, which has a momentary phase increase that is
proportional to sensitivity and input amplitude; see the doxygen
documentation for the frequency_modulator block.

Greetings,
Marcus

On Mon, May 26, 2014 at 10:20 AM, Activecat [email protected] wrote:

Says, your sampling rate is samp_rate

Assuming the lowest input value to the FM block is zero, then
minimum frequency of the FM output = samp_rate * sensitivity / ( 2 * PI )

Assuming the highest input value to the FM block is Vmax, then
maximum frequency of the FM output = samp_rate * ( sensitivity + Vmax )
/ ( 2 * PI)

To avoid disagreement, the sampling rate (samp_rate) refers to the
number
of elements produced by this FM block per second.
If there is no speed-limiting element (throttle, usrp, sound card etc)
in
the flowgraph, then someone may say that samp_rate becomes meaningless,
if
this is the case then in fact frequency also becomes quite meaningless…

On 25.05.2014 20:01, jason sam wrote:

But if it is doing FM then there should be some min and max
frequencies between which the signal will be switching?

If you refer to the source code of the frequency_modulator_fc_impl.cc,
then
the min and max frequencies could be calculated.

Says, your sampling rate is samp_rate

Assuming the lowest input value to the FM block is zero, then
minimum frequency of the FM output = samp_rate * sensitivity / ( 2 *
PI )

Assuming the highest input value to the FM block is Vmax, then
maximum frequency of the FM output = samp_rate * ( sensitivity + Vmax
) /
( 2 * PI)

For reference, the work function of the FM block is as below.

``````int
frequency_modulator_fc_impl::work( int noutput_items,
gr_vector_const_void_star &input_items,
gr_vector_void_star &output_items)
{
const float *in = (const float*)input_items;
gr_complex *out = (gr_complex*)output_items;

for(int i = 0; i < noutput_items; i++)
{
d_phase = d_phase + d_sensitivity * in[i];

while (d_phase > (float)(M_PI))
d_phase -= (float)(2.0 * M_PI);

while (d_phase < (float)(-M_PI))
d_phase += (float)(2.0 * M_PI);

float oi, oq;

gr_int32 angle = gr::fxpt::float_to_fixed (d_phase);
gr::fxpt::sincos(angle, &oq, &oi);
out[i] = gr_complex(oi, oq);
}

return noutput_items;
}``````

Hi Ali,

This is the and thus only comprehensive documentation.
But really, all this block does is, like I in text  and activecat in
text and code tried to explain,
is increase the phase of its output signal by sensitivity*input .
I get the feeling this has been discussed exceedingly enough, and would
like to close this thread.

Greetings,
Marcus

 It outputs a signal, which has a momentary phase increase that is
proportional to sensitivity and input amplitude
 d_phase = d_phase + d_sensitivity * in[i];

ok got it

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs