discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Discuss-gnuradio] Increase sine frequency every N samples


From: Josh Blum
Subject: Re: [Discuss-gnuradio] Increase sine frequency every N samples
Date: Wed, 24 Feb 2010 09:02:14 -0800
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.9pre) Gecko/20100217 Shredder/3.0.3pre

A few tips:

1) you dont have to lock the flow graph to change parameters (just to disconnect and connect blocks)

2) you simplify this problem a bit by using the gr_frequency_modulator_fc block. You can feed the frequency modulator a step function that increases every N samples.

you could probably generate the input to the modulator with a ramp function (sig source), a sample and hold block, and the vector source to control the sample and hold block

-Josh

On 02/24/2010 08:22 AM, Carlos Aviles wrote:
Hi,

I want to generate a sine wave that increases in some kHz its
frequency every N samples it produces.

I know I can change the frequency of the sine using the available
setter method on the gr_sig_source block. My problem is how to perform
that change exactly after N samples have been produced by the
gr_sig_source block. I've come up with some ideas:

- Make the top_block aware of the number of samples that the
gr_sig_source has produced. When N samples are produced, the top_block
could call Lock(), change the parameter, and then Unlock(). My problem
here is how to make the top_block aware of that count. I could use a
"listener block" just after the gr_sig_source and let it count the
samples that pass through it. After N samples, it could trigger some
signal to the top block. I don't like this approach because it seems
too complex.

- Extend the functionality of gr_sig_source to increase the frequency
by itself. By directly extending the class that won't work because
there is no public constructor for gr_sig_source. Is there any other
way of doing that?

- Save N samples of different sine waves into files and then generate
a single one by concatenation. I could use then a file_source block to
incorporate these sine waves into any flow graph. The problem is the
size of the resulting file.

I would appreciate very much any help on that.

I'm using gnuradio-3.2.2 and I want to generate a 100% C++ application.

Thanks,
Carlos.

PS: I haven't posted any code because I don't have any yet :)


_______________________________________________
Discuss-gnuradio mailing list
address@hidden
http://lists.gnu.org/mailman/listinfo/discuss-gnuradio




reply via email to

[Prev in Thread] Current Thread [Next in Thread]