Re: Byte Boundary alignment

2020-07-22 Thread lannan jiang
Hi Kevin,
   Thank you for your reply. Your simple method is what I am trying to do here. 
However, I do not know how to prepend each message with a preamble of known 
bytes in GNU Radio. Could you please elaborate on this? Did you mean that you 
are doing this in Python? Is it with the embedded python block? 
   I have been looking at the Packet Header Generator, i was thinking adding a 
preamble using that, but haven’t had any luck so far. 

   Best regards,
   Lannan 
> On Jul 22, 2020, at 1:59 PM, Kevin McQuiggin (SFU)  wrote:
> 
> Hi Lannan:
> 
> I am working on a similar project in the digital not audio domain.
> 
> There are two approaches.  The simple one, which I am currently using, is to 
> prepend each message with a preamble of known bytes.  Then you recover byte 
> alignment from the received bitstream by using a sliding window over the 
> received bitstream looking for the known pattern.  This gives you an offset 
> and you can recover bytes from there.  
> 
> I am currently doing this realignment in a small Python program that I will 
> eventually integrate into a custom block.
> 
> This method is simple but it has no error detection or correction.  It works 
> for my project, however!  I can transfer megabytes of data successfully at 
> about 130M bps.
> 
> As it’s a learning project, however, I am currently working on a more 
> sophisticated approach.  Please read the gnuradio tutorial on packet 
> transmission and recovery.  Just Google “gnuradio packet” and the article 
> will be near the top.
> 
> This article covers adding proper headers, CRCs, forward error correction et 
> cetera and moving to use of a burst transmission approach.  It is quite 
> complicated but I have the basic techniques “sort of” working with my 
> project.  My goal is to integrate the discussed techniques into the project 
> so I can make my data transfers more robust.
> 
> The article Co es with example flowgraphs which are complicated at first look 
> but through reading the (excellent) explanatory text it becomes clear as to 
> which parts do what, and why.
> 
> Hope this helps.  If you want to discuss the sliding window basic approach 
> then let me know.  As another responder noted you could also conceivably use 
> a Correlation block for this, but you might have to move your data stream 
> into the gnuradio messaging side first.
> 
> Kevin
> 
> 
> 
> 
> 
> Sent from my iPad
> 
> On Jul 22, 2020, at 08:40, lannan jiang  > wrote:
> 
>> Hi everyone, 
>>(It's me again.)
>>I am working on an audio channel using QPSK modulation. I currently am 
>> transmitting through a signal source that outputs bytes. I am looking for a 
>> method to align the byte boundaries so I am able to hear a clean audio at 
>> the receiver. 
>>Here is an idea of what I want to do: send packets that have, for 
>> example, 7 bytes of data and 1 byte of known pattern, and so I can sync with 
>> the receive block. However, I do not know how to implement this in GRC (I 
>> see a block named packet header generator, is this what I want to use?). 
>> Could someone please advise me on how to approach this?
>>
>>Thanks in advance.
>>Lannan Jiang 



smime.p7s
Description: S/MIME cryptographic signature


Re: Byte Boundary alignment

2020-07-22 Thread Kevin McQuiggin (SFU)
Hi Lannan:

I am working on a similar project in the digital not audio domain.

There are two approaches.  The simple one, which I am currently using, is to 
prepend each message with a preamble of known bytes.  Then you recover byte 
alignment from the received bitstream by using a sliding window over the 
received bitstream looking for the known pattern.  This gives you an offset and 
you can recover bytes from there.  

I am currently doing this realignment in a small Python program that I will 
eventually integrate into a custom block.

This method is simple but it has no error detection or correction.  It works 
for my project, however!  I can transfer megabytes of data successfully at 
about 130M bps.

As it’s a learning project, however, I am currently working on a more 
sophisticated approach.  Please read the gnuradio tutorial on packet 
transmission and recovery.  Just Google “gnuradio packet” and the article will 
be near the top.

This article covers adding proper headers, CRCs, forward error correction et 
cetera and moving to use of a burst transmission approach.  It is quite 
complicated but I have the basic techniques “sort of” working with my project.  
My goal is to integrate the discussed techniques into the project so I can make 
my data transfers more robust.

The article Co es with example flowgraphs which are complicated at first look 
but through reading the (excellent) explanatory text it becomes clear as to 
which parts do what, and why.

Hope this helps.  If you want to discuss the sliding window basic approach then 
let me know.  As another responder noted you could also conceivably use a 
Correlation block for this, but you might have to move your data stream into 
the gnuradio messaging side first.

Kevin





Sent from my iPad

> On Jul 22, 2020, at 08:40, lannan jiang  wrote:
> 
> Hi everyone, 
>(It's me again.)
>I am working on an audio channel using QPSK modulation. I currently am 
> transmitting through a signal source that outputs bytes. I am looking for a 
> method to align the byte boundaries so I am able to hear a clean audio at the 
> receiver. 
>Here is an idea of what I want to do: send packets that have, for example, 
> 7 bytes of data and 1 byte of known pattern, and so I can sync with the 
> receive block. However, I do not know how to implement this in GRC (I see a 
> block named packet header generator, is this what I want to use?). Could 
> someone please advise me on how to approach this?
>
>Thanks in advance.
>Lannan Jiang 


Re: Byte Boundary alignment

2020-07-22 Thread lannan jiang
Hi Artur,
   
Thank you for your suggestions! 
And yes, that’s exactly what I am doing. At the receiver, I have a 
polyphase clock sync, CMA equalizer, and a costa loop to correct phase and 
frequency offset. 
I am using Adalm Pluto, which is looping back right now. I am able to align 
the bytes manually by adding delay blocks and compare the bit streams from the 
transmitter and receiver. However, I want to make the bytes align automatically.
I also have been trying to do cross-correlation to find the peak values, 
but the first step for me right now is to find the byte boundary to transmit 
audio.

Best regards,
Lannan 

> On Jul 22, 2020, at 12:13 PM, Artur Nogueira  wrote:
> 
> Hello Lannan,
> 
> As far as I could understand, you want to do the following operations:
> 
> (i) Generate bytes -> (ii) Modulate -> (iii) Transmit -> (iv) Receive -> (v) 
> Demodulate -> (vi) Recover bytes
> 
> and then you want to align the byte sequences from steps (i) and (vi).
> Am I correct?
> What hardware (model) are you using to transmit/receive?
> 
> I've been trying to solve a similar issue lately and I am convinced that my 
> signals are not aligned because of 3 main reasons: wave propagation time, GNU 
> Radio processing time (latency) and carrier frequency offset (CFO).
> What I've been doing is: the two first issues are minimized by applying a 
> cross-correlation operator (not necessarily in GNU Radio; you can 
> post-process using another software if you want) to the transmitted and 
> received  base-band signals. The peak value allows you to find the lag 
> between them.
> The third problem (CFO) comes from an unalignment between the transmitting 
> and receiving units (I use HackRF One) and can be solved with a mixer at the 
> receiver level tuned with the frequency offset value.
> 
> Best regards,
> Artur
> 
> 
> 
> 
> 
> 
> 
> 
> Em qua., 22 de jul. de 2020 às 12:56, lannan jiang  > escreveu:
> Hi everyone, 
>(It's me again.)
>I am working on an audio channel using QPSK modulation. I currently am 
> transmitting through a signal source that outputs bytes. I am looking for a 
> method to align the byte boundaries so I am able to hear a clean audio at the 
> receiver. 
>Here is an idea of what I want to do: send packets that have, for example, 
> 7 bytes of data and 1 byte of known pattern, and so I can sync with the 
> receive block. However, I do not know how to implement this in GRC (I see a 
> block named packet header generator, is this what I want to use?). Could 
> someone please advise me on how to approach this?
>
>Thanks in advance.
>Lannan Jiang 



smime.p7s
Description: S/MIME cryptographic signature


Re: Byte Boundary alignment

2020-07-22 Thread Artur Nogueira
Hello Lannan,

As far as I could understand, you want to do the following operations:

(i) Generate bytes -> (ii) Modulate -> (iii) Transmit -> (iv) Receive ->
(v) Demodulate -> (vi) Recover bytes

and then you want to align the byte sequences from steps (i) and (vi).
Am I correct?
What hardware (model) are you using to transmit/receive?

I've been trying to solve a similar issue lately and I am convinced that my
signals are not aligned because of 3 main reasons: wave propagation time,
GNU Radio processing time (latency) and carrier frequency offset (CFO).
What I've been doing is: the two first issues are minimized by applying a
cross-correlation operator (not necessarily in GNU Radio; you can
post-process using another software if you want) to the transmitted and
received  base-band signals. The peak value allows you to find the lag
between them.
The third problem (CFO) comes from an unalignment between the transmitting
and receiving units (I use HackRF One) and can be solved with a mixer at
the receiver level tuned with the frequency offset value.

Best regards,
Artur








Em qua., 22 de jul. de 2020 às 12:56, lannan jiang 
escreveu:

> Hi everyone,
>(It's me again.)
>I am working on an audio channel using QPSK modulation. I currently am
> transmitting through a signal source that outputs bytes. I am looking for a
> method to align the byte boundaries so I am able to hear a clean audio at
> the receiver.
>Here is an idea of what I want to do: send packets that have, for
> example, 7 bytes of data and 1 byte of known pattern, and so I can sync
> with the receive block. However, I do not know how to implement this in GRC
> (I see a block named packet header generator, is this what I want to use?).
> Could someone please advise me on how to approach this?
>
>Thanks in advance.
>Lannan Jiang
>