Re: [Discuss-gnuradio] Question about stream to complex and fft

2019-06-14 Thread Kyeong Su Shin
Hello S. L.:


Short Version:

Yes, you are correct!


Some picky details:

Due to technical limitations, the output timing of the Throttle block is not 
perfect (but should be good enough, for most practical use cases). Also, due to 
this, the Throttle block may output more than one samples at a time.


GNU Radio blocks use buffers to communicate. A block outputs data by writing 
the generated data into its output buffer. The next block in the chain 
considers this buffer as an input buffer, and reads data from it. It then tells 
the previous block that the data has been read, so as the previous block can 
generate more data. The Throttle block intentionally slows down this process.


But in overall, your idea is correct.


Regards,

Kyeong Su Shin



보낸 사람: S. L. 
보낸 날짜: 2019년 6월 14일 금요일 오후 9:26:45
받는 사람: Kyeong Su Shin; discuss-gnuradio@gnu.org; rear1019
제목: RE: Question about stream to complex and fft

Thank you very much for your responses

So, if for example, I want to simulate 1 second of a cosine wave of 1K, with 
sample rate of 32K as the example and I have a very powerful computer the 
signal source block (cosine) could generate the 32k samples in 0.5 seconds , 
but the 32K wave samples of a 1K would correspond to real (good) values as if 
it had been sampling for 1 second ... Is that correct?

And if I put a Throttle block at the output of the signal source block at 32K 
of sample rate, the throttle block will receive the 32k samples as input at a 
lower time, store them in a buffer and direct them to the output at the precise 
moment, it is say every 1 / 32K ms ... Is this correct?

Thank you very much for your time and for your kindness


De: Kyeong Su Shin 
Enviado: viernes, 14 de junio de 2019 13:31
Para: S. L.; discuss-gnuradio@gnu.org
Asunto: RE: Question about stream to complex and fft


Hello S.L:


That sounds correct to me.


One note, however: the sampling rate in GNU Radio is just a conceptual thing, 
and does not determine the 'actual time that GNU Radio takes to generate or 
consume the samples', if you do not use hardware sinks/sources (like SDR 
sources) and/or throttle blocks. If your flowgraph does not have such blocks, 
then the flowgraph will execute 'as fast as it can'. The data generated by your 
program will be still correct; it is just that the 'time' is just a conceptual 
thing (so as you don't have to deal with normalized sampling rates) and may not 
agree with the actual execution speed of the program.


Kyeong Su Shin



보낸 사람: S. L.  대신 Discuss-gnuradio 

보낸 날짜: 2019년 6월 14일 금요일 오후 6:08:55
받는 사람: discuss-gnuradio@gnu.org
제목: [Discuss-gnuradio] Question about stream to complex and fft

Hello, I have a question about the real-time operation of gnuradio and the 
"stream-to-vector" and FFT modules "

In the example image I have:

variable samp_rate to 32K

and the following flowchart:

Signal source (waveform: cosine, sample_rate: 32K, frecuency: 1K) -> 
stream-to-vector (Num items: 1024) -> FFT (size: 1024) -> Complex-to-Mag 
(Vector lenght: 1024) - > QT GUI Vector Sink (Vector size: 1024)

Then cosine has 1K of frequency and sample rate is 32K and FFT size is 1024

I'm not really sure how the gnuradio simulation works so I'd like to check it 
with you and see if I'm right or I'm wrong

A whole cosine wave would take 1ms
since the sample rate is 32K, a cosine wave would be 32 samples
Then 1024 samples would be 1024/32 = 32 cosine waves, that is 32 * 1 ms = 32 ms

Then:

Since I have vector-to-stream and fft to 1024 samples, I think or I guess it 
stores the first 1024 samples (from 0 ms to 32 ms) and the vector-to-stream 
module passes those samples to the FFT module that performs the FFT of those 
1024 samples
Then another 1024 samples (form 32 ms to 64 ms) would arrive and I would pass 
those samples to the FFT

That is, the FFT block performs its function every 32 ms with 1024 sample 
vectors

Is this operating logic on the stream-to-vector and fft block correct? or I'm 
wrong

Thank you very much everyone for your time
a greeting

___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio


Re: [Discuss-gnuradio] Question about stream to complex and fft

2019-06-14 Thread S. L.
Thank you very much for your responses

So, if for example, I want to simulate 1 second of a cosine wave of 1K, with 
sample rate of 32K as the example and I have a very powerful computer the 
signal source block (cosine) could generate the 32k samples in 0.5 seconds , 
but the 32K wave samples of a 1K would correspond to real (good) values as if 
it had been sampling for 1 second ... Is that correct?

And if I put a Throttle block at the output of the signal source block at 32K 
of sample rate, the throttle block will receive the 32k samples as input at a 
lower time, store them in a buffer and direct them to the output at the precise 
moment, it is say every 1 / 32K ms ... Is this correct?

Thank you very much for your time and for your kindness


De: Kyeong Su Shin 
Enviado: viernes, 14 de junio de 2019 13:31
Para: S. L.; discuss-gnuradio@gnu.org
Asunto: RE: Question about stream to complex and fft


Hello S.L:


That sounds correct to me.


One note, however: the sampling rate in GNU Radio is just a conceptual thing, 
and does not determine the 'actual time that GNU Radio takes to generate or 
consume the samples', if you do not use hardware sinks/sources (like SDR 
sources) and/or throttle blocks. If your flowgraph does not have such blocks, 
then the flowgraph will execute 'as fast as it can'. The data generated by your 
program will be still correct; it is just that the 'time' is just a conceptual 
thing (so as you don't have to deal with normalized sampling rates) and may not 
agree with the actual execution speed of the program.


Kyeong Su Shin



보낸 사람: S. L.  대신 Discuss-gnuradio 

보낸 날짜: 2019년 6월 14일 금요일 오후 6:08:55
받는 사람: discuss-gnuradio@gnu.org
제목: [Discuss-gnuradio] Question about stream to complex and fft

Hello, I have a question about the real-time operation of gnuradio and the 
"stream-to-vector" and FFT modules "

In the example image I have:

variable samp_rate to 32K

and the following flowchart:

Signal source (waveform: cosine, sample_rate: 32K, frecuency: 1K) -> 
stream-to-vector (Num items: 1024) -> FFT (size: 1024) -> Complex-to-Mag 
(Vector lenght: 1024) - > QT GUI Vector Sink (Vector size: 1024)

Then cosine has 1K of frequency and sample rate is 32K and FFT size is 1024

I'm not really sure how the gnuradio simulation works so I'd like to check it 
with you and see if I'm right or I'm wrong

A whole cosine wave would take 1ms
since the sample rate is 32K, a cosine wave would be 32 samples
Then 1024 samples would be 1024/32 = 32 cosine waves, that is 32 * 1 ms = 32 ms

Then:

Since I have vector-to-stream and fft to 1024 samples, I think or I guess it 
stores the first 1024 samples (from 0 ms to 32 ms) and the vector-to-stream 
module passes those samples to the FFT module that performs the FFT of those 
1024 samples
Then another 1024 samples (form 32 ms to 64 ms) would arrive and I would pass 
those samples to the FFT

That is, the FFT block performs its function every 32 ms with 1024 sample 
vectors

Is this operating logic on the stream-to-vector and fft block correct? or I'm 
wrong

Thank you very much everyone for your time
a greeting

___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio


Re: [Discuss-gnuradio] Question about stream to complex and fft

2019-06-14 Thread rear1019
On Fri, 14 Jun 2019 at 09:08:55 +, S. L. wrote:
> Since I have vector-to-stream and fft to 1024 samples, I think or I
> guess it stores the first 1024 samples (from 0 ms to 32 ms) and the
> vector-to-stream module passes those samples to the FFT module that
> performs the FFT of those 1024 samples Then another 1024 samples (form
> 32 ms to 64 ms) would arrive and I would pass those samples to the FFT
>
> That is, the FFT block performs its function every 32 ms with 1024
> sample vectors
>
> Is this operating logic on the stream-to-vector and fft block correct?
> or I'm wrong

Your description of what happens is correct: The stream to vector block
waits for N samples and passes them to the FFT block (N being the vector
size). Strictly speaking the stream to vector blocks waits for n·N
samples where n is a positive integer, i.e. the delay can be bigger than
N samples. The value of n is determined by GNU Radio’s scheduler and is
not necessarily constant during the simulation.

The temporal aspect of your description is only correct if you refer to
the time passed “inside” the simulation. The time passed from the point
of view of a user watching the simulation (“real time”) may be
different. Your flowgraph does not restrict the processing speed, i.e.
generating and processing 32k samples will probably (depending on CPU)
take less than 1 second of real time. See also reply by Kyeong Su Shin.

___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio


Re: [Discuss-gnuradio] Question about stream to complex and fft

2019-06-14 Thread Kyeong Su Shin
Hello S.L:


That sounds correct to me.


One note, however: the sampling rate in GNU Radio is just a conceptual thing, 
and does not determine the 'actual time that GNU Radio takes to generate or 
consume the samples', if you do not use hardware sinks/sources (like SDR 
sources) and/or throttle blocks. If your flowgraph does not have such blocks, 
then the flowgraph will execute 'as fast as it can'. The data generated by your 
program will be still correct; it is just that the 'time' is just a conceptual 
thing (so as you don't have to deal with normalized sampling rates) and may not 
agree with the actual execution speed of the program.


Kyeong Su Shin



보낸 사람: S. L.  대신 Discuss-gnuradio 

보낸 날짜: 2019년 6월 14일 금요일 오후 6:08:55
받는 사람: discuss-gnuradio@gnu.org
제목: [Discuss-gnuradio] Question about stream to complex and fft

Hello, I have a question about the real-time operation of gnuradio and the 
"stream-to-vector" and FFT modules "

In the example image I have:

variable samp_rate to 32K

and the following flowchart:

Signal source (waveform: cosine, sample_rate: 32K, frecuency: 1K) -> 
stream-to-vector (Num items: 1024) -> FFT (size: 1024) -> Complex-to-Mag 
(Vector lenght: 1024) - > QT GUI Vector Sink (Vector size: 1024)

Then cosine has 1K of frequency and sample rate is 32K and FFT size is 1024

I'm not really sure how the gnuradio simulation works so I'd like to check it 
with you and see if I'm right or I'm wrong

A whole cosine wave would take 1ms
since the sample rate is 32K, a cosine wave would be 32 samples
Then 1024 samples would be 1024/32 = 32 cosine waves, that is 32 * 1 ms = 32 ms

Then:

Since I have vector-to-stream and fft to 1024 samples, I think or I guess it 
stores the first 1024 samples (from 0 ms to 32 ms) and the vector-to-stream 
module passes those samples to the FFT module that performs the FFT of those 
1024 samples
Then another 1024 samples (form 32 ms to 64 ms) would arrive and I would pass 
those samples to the FFT

That is, the FFT block performs its function every 32 ms with 1024 sample 
vectors

Is this operating logic on the stream-to-vector and fft block correct? or I'm 
wrong

Thank you very much everyone for your time
a greeting

___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio