?? qpsk.c
字號:
#define LEN 128
#define LENFFT 127
#define LENFFT2 124
void qpsk(float *output, unsigned int *input)
{
const short im_p4[] = {-1, 1, 1, 1, -1, -1, 1, -1};
short i, tmp=0; // The tmp is the index number which defines the value of the bits defined by b.
short b2=0; // which int[x] from input should be used.
short b3=0; // which bit in the int is our first bit to consider.
// '0' indicates the first int.
// '0' indicates the first bit of an int.
for(i=0; i<LEN; i++){
tmp = (input[b2]&(0x03 << b3)) >> b3; // get the 2 bits and shift to become a correct index
output[i*2] = im_p4[tmp*2];
output[i*2+1] = im_p4[tmp*2+1];
b3 +=2;
if(b3==32){
b3=0;
b2++;
}
}
}
void qpskfft(float *output, unsigned int *input, short index)
{
const short im_p4[8] = {-1, 1, 1, 1, -1, -1, 1, -1};
short i, tmp; //The tmp is the index number which defines the value of the bits defined by b.
// '0' indicates the first int.
// '0' indicates the first bit of an int.
short b2=0; //which int[x] from input should be used.
short b3=index; // which bit in the int is our first bit to consider.
for(i=0; i<LENFFT; i++){
tmp = (input[b2]&(0x03 << b3)) >> b3; // get the 2 bits and shift to become a correct index
output[i*2] = im_p4[tmp*2];
output[i*2+1] = im_p4[tmp*2+1];
b3 +=2;
if(b3==32){
b3=0;
b2++;
}
}
}
void qpskfft2(float *output, unsigned int *input, short index)
{
const short im_p4[8] = {-1, 1, 1, 1, -1, -1, 1, -1};
short i, tmp; //The tmp is the index number which defines the value of the bits defined by b.
// '0' indicates the first int.
// '0' indicates the first bit of an int.
short b2=0; //which int[x] from input should be used.
short b3=index; // which bit in the int is our first bit to consider.
for(i=0; i<LENFFT2; i++){
tmp = (input[b2]&(0x03 << b3)) >> b3; // get the 2 bits and shift to become a correct index
output[i*2] = im_p4[tmp*2];
output[i*2+1] = im_p4[tmp*2+1];
b3 +=2;
if(b3==32){
b3=0;
b2++;
}
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -