Generate a specific wave form

Hello, guys.

I need a help, please. I need to generate the kind of wave showned in
the picture attached, but I don’t know which are the proper blocks.
Can anyone help me, please?

Image’s credits:
http://www.ece.uvic.ca/~elec350/lab_manual/ar01s04s05.html

Hi Antonny,

There’s the CPFSK block; If your picture is actually showing the
frequency domain representation of the signal you want to get, then this
is most likely what you directly want to use.

By the way, I do recommend you just sign up to the GNU Radio mailing
list with a proper email address under:
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
Going through ruby-forum (which we don’t have any affiliation too, as
far as I can tell) is more than bothersome, as replies tend to get lost.

Best regards,
Marcus

If those overshoots are unwanted but inevitable due to hardware
characteristics and limitations,

you can generate a wave form with vector source with input sequence
1010010000111…

Then, the output will be HLHLLHLLLLHHH… (H = HIGH, LOW = LOW)

Regards,
Jeon.

2015-06-29 23:23 GMT+09:00 Antonny C. [email protected]:

Jeon wrote in post #1175836:

If those overshoots are unwanted but inevitable due to hardware
characteristics and limitations,

you can generate a wave form with vector source with input sequence
1010010000111…

Then, the output will be HLHLLHLLLLHHH… (H = HIGH, LOW = LOW)

Regards,
Jeon.

2015-06-29 23:23 GMT+09:00 Antonny C. [email protected]:

Well, I don’t think this solution using vector works (I might be wrong,
of course). I tried to build it in Gnuradio 3.7.2.1 (Ubuntu 14.04 LTS).
The prints are shown below:

Blocks:

Input signal:

Output Signal:

Vector created:

What I need to do is a kind of “switch”. With this vector in the Ctrl
Port of the Sample & Hold, I want the same wave of the input in the
output, but appearing and desappearing according to the Vector Source (0

  • no signal, 1 - entire signal).

If the signal in the Input Port is a square wave, then I want the same
wave but appearing and desappearing in a random way according to the
vector I created, but It isn’t happening.

I don’t know if I was clear enough. Please, help me and tell me if you
need more details about my problem.

Sorry and thank you.

Marcus, I’m using it because the vector isn’t the signal I want. The
vector is just to control when a signal goes to the output and when it
doesn’t. Like I said: 0 - no signal, 1 - entire signal.

The sample and Hold block should pass the signal to the output when ctrl
= 1 and hold the output when ctrl = 0, but it doesn’t happen and I don’t
know why.

Have you tried to miltuply the signals?
Because your vector source outputs ones and zeros it will not change the
shape of the signal but it will enable (.1) or disable (.0) the original
signal.

Why do you use the sample and hold block?
You could use
vector_source->(throttle)->QT time sink

Best regards,
Marcus

Rafael,

Yes, I have… It didn’t work either and I don’t know why. The first
thing I tried was multiply the signals. It’s really strange.

There are some blocks in GNURadio that don’t do what they say they do,
like this Sample and Hold block. This block don’t “hold” the samples,
like it should do.

The implementation of Sample and Hold, for example, in another softwares
work perfectly, but in GNURadio it doesn’t and it is a standard block.
It’s very strange.


Discuss-gnuradio mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio

0= no signal, 1 = full signal:
then just use a multiplier!

Best regards,
Marcus

Rafael and Marcus,

I see what you mean, but you didn’t understand what I wanna do.
Using a multiplier you are modificating the original signal. I don’t
want to multiply the samples, I want nothing or the entire signal.

What I mean is:
0 = no signal at all, everything is 0 and not only a piece of the
signal. The entire sine wave times 0 -> sine x 0 = 0.
1 = the entire signal, but not only a sample x 1, like you showed. I
need to multiply everything by 1 and leave the signal pass.

Abstract:

“Nothing” if the control is 0, and “EVERYTHING” if the control is 1. I
don’t need pieces of wave times 0 or 1, I need the whole signal times 0
or 1, like a switch. Did you get it? It’s hard to build it here.

Thanks a lot.

Dear Caesar,

If there’s a certain purpose of this work but that is not explained this
post, it’s better for us to know the purpose.
But, you might not want to explain that if it is confidential.

Anyway,
The original signal stays unmodified. You can get the original signal by
connecting the original source block to another block.
And you can get the whole part of the the original signal or nothing by
setting duration, repetition or interpolation of each bit from a vector
stream, which will be a multiplier.

You can easily set a length/duration of each sample from a vector source
by
using repeat block.
The figure above will generates 200 zeros, 200 ones, 200 zeros and 200
ones.
It is equivalent to a vector source with (0, 0, 0, …, 1, 1, 1, …, 0,
0,
0, …, 1, 1, 1, …)

But, if you want something different,
for example, if you want to pause/stop the signal source block (or USRP
source block, etc.) temporarily when the switch block (the vector source
block or other trigger blocks) give zero
and resume the source block when the switch block gives one,
it seems you need to approach the problem in a different way.

As I read your question again, it seems that you want a flow graph to
output literally ‘nothing’ not even zero, is it right?
In other words, you want to drop a part of the original signal when the
switch value is zero.
In that case, a valve block might help you. But I doubt that a vector
source can be an argument of the valve block.
(I might be wrong. There can be a block can do what you want, but not
sure
about it.)

I recommend you to build a pass-or-drop, pass-or-block block.

Regard,
Jeon.

2015-07-01 11:59 GMT+09:00 Antonny C. [email protected]:

Hi Antonny,
I might really just have misunderstood what you want.
If Jeon’s reply didn’t solve your problem, I’d like to ask you to draw a
proper diagram, with labeled axes, and your signal, and when and why
that signal has a specifix value, and what kind of things you want to
feed in and what kind of things you want to get out.

Best regards,
Marcus

Hi Antonny,

A primary user might be sending a signal all the time (this is my signal
source block). During this event, my Energy Detector will analyse the
spectro and pass or not the signal of my primary user (the entire
signal, everything that is being sent),
That is exactly the functionality of the power_squelch block :slight_smile:
because that’s what a cognitive radio does.
Well, yours :slight_smile:
So, when it’s possible, I will use the spectro to send a few
informations.
I’m still not totally clear on what kind of signal you want to
produce, or whether you describe a temporal behaviour of your system.

What aspect of your implementation are you currently working on? The
Energy Detector/pass-through functionality?

Best regards,
Marcus

PS: I think you’ve described your thing pretty well, I’m just not
getting it, sorry.
I think at this point, a drawing with a few annotations of what your
system should do would do wonders, because then we’d have something
clear to refer to when discussing!

Jeon and Marcus,

I’m very happy you’re helping me. This is the first time I use
GNURadio and it’s very different of other softwares I usually work.

I can tell you my purpose, no problem at all. I’m trying to start a
project about Cognitive Radio. For now, I want to build an Energy
Detector.

A primary user might be sending a signal all the time (this is my signal
source block). During this event, my Energy Detector will analyse the
spectro and pass or not the signal of my primary user (the entire
signal, everything that is being sent), because that’s what a cognitive
radio does. So, when it’s possible, I will use the spectro to send some
information.
When the spectro is being used (vector = 0, for example), I can’t send
information, because it would damage the signal of other person. I just
want to send data, when the spectro is not being used (vector = 1).

To simulate this analysis, I was trying to use a vector source or a
random source, because it’s impossible to know when the spectro will be
free; it’s random.

I think it’s easier to understand now. Thank you a lot for helping me
here, guys.

On 01/07/15 14:20, Antonny C. wrote:

A primary user might be sending a signal all the time (this is my signal
source block). During this event, my Energy Detector will analyse the
spectro and pass or not the signal of my primary user (the entire
signal, everything that is being sent), because that’s what a cognitive
radio does. So, when it’s possible, I will use the spectro to send a few
informations.
When the spectro is being used (vector = 0, for example), I can’t send
information, because it would damage the signal of other person. I just
want to send data, when the spectro is not being used (vector = 1).

Do you mean that you want to “pause” the transmission or that you want
to “mute” the transmission?

Cheers,
Daniele

Daniele,

Mute the transmission is closer to the reality, because when the
spectrum is being used by another person, the signal I’m sending will be
lost.

Thank you.

Marcus,

Yes! For now, the pass-through functionality is fine for me. I saw the
Power Squelch block but it doesn’t have a “control input” to decide when
my signal will pass through.

This signal can be a sine, square wave, etc, but I think it isn’t
important, because if I have the Energy Detector working fine, it will
always do its function, right?

The Detector can’t decide according to the signal I want to send. The
decision is made according to the spectrum, that is, my vector (0 or 1).

Like a tap: I have a control(vector) and the water (my signal) goes down
according to the opening (vector = 0 or vector = 1). The amount of water
that goes down doesn’t need to “analyse the water”, just the control
(vector) and then, leave the water pass.

Using a tap was my best explanation for now haha

Again, thank you a lot.

Antonny,

On 07/01/2015 03:08 PM, Antonny C. wrote:

Marcus,

Yes! For now, the pass-through functionality is fine for me. I saw the
Power Squelch block but it doesn’t have a “control input” to decide when
my signal will pass through.
Well, the job of the power squelch is to figure out whether the signal
should be passed through, based on the signal itself.
This signal can be a sine, square wave, etc, but I think it isn’t
important, because if I have the Energy Detector working fine, it will
always do its function, right?
Well, if that signal has energy (as defined by your Energy detector),
yes, I guess.
The Detector can’t decide according to the signal I want. The decision
is made according to the spectrum, that is, my vector (0 or 1).
I don’t understand. “The spectrum”: What does this mean to you?
Spectrum is usually used as a expression describing the wholeness of
signals in a given frequency range.
Like a tap: I have a control(vector) and the water (my signal) goes down
according to the opening. The amount of water that goes down doesn’t
need to “analyse the water”, just the control (vector) and then, leave
the water pass.
So the question is: Your control can be 0 or 1, right? (Please reply
in-line)

Let’s define:
n_in = samples going into your “tap”
n_out = samples coming out of your “tap”
n_ctrl = control values going into your “tap”

While the control is 0, do you
a) want your samples coming out of the “tap” to be constant 0, meaning
that n_in=n_out=n_ctr, OR
b) want the samples to just be dropped, n_in = n_ctrl, n_in < n_out;
c) you want your tap to just let samples through when control is 1, so
that it behaves like a real water tap, holding water back, meaning that
n_in = n_out > n_ctrl

Using a tap was my best explanation for now haha
That’s why I still ask you for a quick drawing :slight_smile:

Best regards,
Marcus

Marcus,

I made the drawing; it’s attached. I want the entire signal or “nothing”
in the output.
It’s the same of multiplying my signal by 0 or 1. The problem is: these
factors (0 and 1) have to appear in a random way. I can’t predict it,
that is, I don’t know when the output is “nothing” or the entire signal,
that’s what I need.

I think it’s easier now.

Thank you.