How to hold a values from file source

Currently I am trying to make an ASK (Amplitude Shift Keying)

I use GNURadio Companion,

The program gets the input from file source and multiplies it with
signal
source.

And I monitors via Scope and FFT plots

You can see a diagram ASK.grc (image) http://goo.gl/0WHt

And the result is somewhat weird. Plots (image) http://goo.gl/UcF9

It seems sinusoidal, but the shape looks like sawtooth!

I thought that the program couldn’t hold values from file source

So, I am wandering whether there is a method for holding a value

On 10/26/2010 10:17 PM, songsong gee wrote:

And the result is somewhat weird. Plots (image)http://goo.gl/UcF9

It seems sinusoidal, but the shape looks like sawtooth!

You are multiplying random 1s and 0s by a sinusoid. And you have a
sinusoid that is randomly either 0 or sine(x). It looks correct!

Perhaps you want to increase the temporal width of your symbols? In that
case, I suggest using the repeat block.

_josh

For more details, I have two files for test. One is ‘all1’ and another
is
‘all0’

±--------------------------------------------+ ‘all1’
|11111111111111111111111111|
±--------------------------------------------+ result
http://goo.gl/fPHK(image)

±--------------------------------------------+ ‘all0’
|00000000000000000000000000|
±--------------------------------------------+ result
http://goo.gl/P1HH(image)

(For convenience, I copied links to a diagram ASK.grc
http://goo.gl/0WHt(image))

It seems that reading 0’s appear more frequently in test with ‘all0’
So… I think it works somehow but… not perfect because non-zero
values
never appear in sending a 0 bit.
I think there might be a somewhat ‘blank out’ of values from file source

Is it inevitable when using file source block?
Or Is it a somewhat sync problem?

I’m new to GRC so it’s a kind of hard things :frowning:

2010/10/27 Josh B. [email protected]

Ok. I see the pattern…

‘0’ = 00110000

‘1’ = 00110001

Your plots look like one of the above patterns repeating. You literally
put the ascii characters ‘1’ and ‘0’ into a binary file. facepalm

-josh

For more details, I have two files for test. One is ‘all1’ and another
is
‘all0’

±--------------------------------------------+ ‘all1’
|11111111111111111111111111|
±--------------------------------------------+ result
http://goo.gl/fPHK(image)

±--------------------------------------------+ ‘all0’
|00000000000000000000000000|
±--------------------------------------------+ result
http://goo.gl/P1HH(image)

(For convenience, I copied links to a diagram ASK.grc
http://goo.gl/0WHt(image))

It seems that reading 0’s appear more frequently in test with ‘all0’
So… I think it works somehow but… not perfect because non-zero
values
never appear in sending a 0 bit.
I think there might be a somewhat ‘blank out’ of values from file source

Is it inevitable when using file source block?
Or Is it a somewhat sync problem?

I’m new to GRC so it’s a kind of hard things :frowning:

2010/10/27 Josh B. [email protected]

I tested this with a vector source that was either all 0s or all 0xffs
and it behaves as expected. Every byte in your file should be 0 or 0xff.
Is this the case? -josh

On 10/27/2010 11:58 AM, Josh B. wrote:

-josh

Good sleuthing, Josh.

Looking at the flow-graph, it seems like the modulation “bits” are
running at the same rate as the carrier frequency, which won’t work–not
even slightly.

Generally in AM/ASK, the modulation frequency is much lower than the
carrier frequency, my gut is that you’d need at least several cycles
of carrier between each bit.


Marcus L.
Principal Investigator
Shirleys Bay Radio Astronomy Consortium

Thank you for your advice.
I’ve tried to use 0x00 and 0xFF, and it works
Your advice is very helpful :slight_smile:

2010/10/28 Josh B. [email protected]

Thank you.
I made it with help of josh’s
and your advice about frequency is helpful, too. :slight_smile:

2010/10/28 Marcus D. Leech [email protected]

On 10/27/10 1:23 PM, Marcus D. Leech wrote:

Looking at the flow-graph, it seems like the modulation “bits” are
running at the same rate as the carrier frequency, which won’t work–not
even slightly.

Generally in AM/ASK, the modulation frequency is much lower than the
carrier frequency, my gut is that you’d need at least several cycles
of carrier between each bit.

In addition, the two sample rates flowing into the multiplier are
different. The 47 kHz “carrier” has a sample rate of 3Meg, while the
digital data has a sample rate of 47K. You will need to upsample
your data stream to the same sample rate as the carrier. Since there
isn’t an integer ratio between the two rates, you’ll have to use
the rational_resampler block.

@(^.^)@ Ed