# Sample rate

**URL:** <https://www.ruby-forum.com/t/sample-rate/232369>\
**Category:** GNU Radio\
**Created:** [October 6, 2014, 10:53am UTC](https://www.ruby-forum.com/t/sample-rate/232369 "2014-10-06T10:53:30Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![addis\_a](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/c4cdca/32.png) [@addis\_a](https://www.ruby-forum.com/u/addis_a)\
**Post date:** [October 6, 2014, 10:53am UTC](https://www.ruby-forum.com/t/sample-rate/232369/1 "2014-10-06T10:53:30Z")

</div>

Hi all:  
Thanks in advance.  
Example:gnuradio/gr-digital/examples/ofdm/rx\_ofdm.grc.  
If I set the sample rate of usrp equal to 1Msps,then what is  
the sample rate of the output of the FFT block?Thank you very much.  
Best regards,  
xd

---

<div class="post-metadata">

**Author:** ![xianda](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/x/b38774/32.png) [@xianda](https://www.ruby-forum.com/u/xianda)\
**Post date:** [October 6, 2014, 11:12am UTC](https://www.ruby-forum.com/t/sample-rate/232369/2 "2014-10-06T11:12:33Z")

</div>

The question is ill-formed, the concept of a ‘sampling rate’ does not  
really apply here.

However, to an item rate, you can do the math yourself:

Assume N is the FFT length, and CP the length of cyclic prefix in  
samples. r is the incoming sampling rate.

First, data goes through the HPD, which takes out the CP. The outgoing  
rate of that block is thus

r2 = (N+CP)/N \* r

Actually, it’s output is already OFDM symbols (“FFT-ready”). So, the  
output item rate is

r3 = r2/N

Then, the packet header is removed. This further reduces the rate, but  
let’s ignore that. It’s also dependent on the packet length.

Since the FFT doesn’t change the rate, what you want is most likely r3.

M

---

<div class="post-metadata">

**Author:** ![xianda](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/x/b38774/32.png) [@xianda](https://www.ruby-forum.com/u/xianda)\
**Post date:** [October 6, 2014, 11:20am UTC](https://www.ruby-forum.com/t/sample-rate/232369/3 "2014-10-06T11:20:46Z")

</div>

Hi Martin:  
Thank you so much.I understand.  
Best regards,  
xd

---

<div class="post-metadata">

**Author:** ![xianda](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/x/b38774/32.png) [@xianda](https://www.ruby-forum.com/u/xianda)\
**Post date:** [October 6, 2014, 3:40pm UTC](https://www.ruby-forum.com/t/sample-rate/232369/4 "2014-10-06T15:40:14Z")

</div>

Obviously I flipped the fraction. It’s N/(N+CP).

M

---

<div class="post-metadata">

**Author:** ![xianda](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/x/b38774/32.png) [@xianda](https://www.ruby-forum.com/u/xianda)\
**Post date:** [October 6, 2014, 11:31am UTC](https://www.ruby-forum.com/t/sample-rate/232369/5 "2014-10-06T11:31:30Z")

</div>

Hi Martin:  
Thanks.But I’m confused about it.

```
        First, data goes through the HPD, which takes out the CP. 

```

The outgoing rate of that block is thus  
r2 = (N+CP)/N \* r

```
       Now r2>r.But according to the downsampling,when the sample 

```

become less than before,the sample rate become smaller than before.Now  
the data goes through the HPD,the sample become less ,but the r2\>r?Maybe  
I’m wrong.Can you help me?Thanks.  
I think maybe this:r2=r\*N/(N+CP)  
Best regards,  
xd

---

<div class="post-metadata">

**Author:** ![xianda](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/x/b38774/32.png) [@xianda](https://www.ruby-forum.com/u/xianda)\
**Post date:** [October 6, 2014, 4:19pm UTC](https://www.ruby-forum.com/t/sample-rate/232369/6 "2014-10-06T16:19:29Z")

</div>

Hi Martin:  
Thanks.  
If I add a block(Vector to Stream) after FFT block.Then  
the sample rate become r4=r3\*N.  
Am I right?Thank you very much.  
Best regards,  
xd
