亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? receiver.c

?? DSP tms320c6713: PSK modulation
?? C
字號:
//Receiver.c Demodulates received BPSK voice signal 
#include "dsk6713_aic23.h"			//codec-DSK support file
#include <math.h>

Uint32 fs=DSK6713_AIC23_FREQ_96KHZ;		//set sampling rate
#define 	NUMSAMP			8			// # Samples per Symbol
#define		NUM_BITS		100
#define PI					3.1415926
#define SYNC_INTERVAL		100			// Interval between sync sequence
short carrier_sample;			// input sample
short data_sample;

short carrier_symbol[NUMSAMP];	// buffer to received one period of carrier
short data_symbol[NUMSAMP*2];	// buffer to received one period of data

short csIndex=0;				// symbol buffer index
short dsIndex=NUMSAMP;				// symbol buffer index
short phIndex=0;

#define NPHI 100
float phiBuf[NPHI]={0};			// buffer to view phi estimates from PLL
short phiBind=0;				// phi buffer index
short phiLoop = 0;				// Used to determine if Phi looped beyond 0<phi<2PI

float sin_table[96*NUMSAMP];	// a table of 3 periods of a sin wave
short pow_table[16];			// a table of powers of two

float y1, y2;					// correlation vectors
float phi=PI;					// phase estimate
float dphi = 0;					// change in phi
float damp=1;					// damping factor

short decSeqNum = 0;			// Number of encoded bits
short decodeSeq[9]={0};			// Encoder Symbol Index

short syncSequence[8] = {1,1,1,0,1,0,0,1};	// Syncronization Sequence
short syncTrigger = 0;			// Trigger to determine if Sync Seq is found
short syncInterval = 0;			// Looks for the interval between Sync Seqs
short rBit[2];					// Received bits
short bits[8]={0};				// Received bits in one frame
short bitIndex=0;				// Index into frame
short nrBits = 0;				// Determines how many received bits are in buffer

short out_sample = 0;			// current received sample
short prev_sample = 0;			// previously received sample
short prev_sample2 = 0;			// received two sample before current sample
short outInc = 0;				// Increments through the interpolation polynomial

// DEBUG VARIABLES

short TrigBuffer[200] = {0};	// Used to look at incoming trigger values
short tbIndex = 0;				// Index into TrigBuffer
short carrierBuffer[1000];		// Buffer for the carrier wave
short dataBuffer[1000];			// Buffer for the BPSK Data wave
short bufIndex = 0;				// Index into carrierBuffer & dataBuffer

short sampleBuffer[2000];		// Buffer of output Samples
short sBuffer = 0;				// Index into sampleBuffer

int X=0;						// Used in correlation receiver

interrupt void c_int11()            //interrupt service routine
{

	int i,j;
	int max=1;
	
  	carrier_sample = (short) input_right_sample(); //receive carrier
	data_sample = (short) input_left_sample(); 	// receive data		
		
	carrier_symbol[csIndex++] = carrier_sample;	// put carrier in symbol buffer
	data_symbol[dsIndex++] = data_sample;		// put data in symbol buffer
	
	carrierBuffer[bufIndex] = carrier_sample;	// debug carrier values
	dataBuffer[bufIndex] = data_sample;			// debug data values
	
	if(++bufIndex >= 1000)
		bufIndex = 0;

   	if(csIndex >= NUMSAMP)				// after one period is received
	{									// then perform phi estimate
		y1 = 0;							
		y2 = 0;
		csIndex = 0;					// Reset Index
		dsIndex = NUMSAMP;
		
		for(i=0; i<NUMSAMP; i++)		// correlate received carrier symbol
		{
			y1 += carrier_symbol[i]*sin_table[32*(NUMSAMP + i + phIndex) - 1];
			y2 += carrier_symbol[i]*sin_table[32*(NUMSAMP + i + phIndex) + 1];
			if(carrier_symbol[i] > max)
				max = carrier_symbol[i];
		}		
		if(max != 0)
		{
			y1 = y1 / max;					// normalize correlation coefs
			y2 = y2 / max;
		}
		else
		{
			max = 1;
		}
		dphi = 0.2*(y2 - y1);			// Calculate derivative to find the maximum
										// of the matched filter
		if(dphi > PI)					// help keep phi within 0<phi<2*PI
			dphi = PI;
		phi = phi + dphi;				// determine new estimate for phi
		phiLoop = 0;
		if(phi < 0)						// normalize phi to 0<phi<2*PI
		{
			phi = phi + 2*PI;	
			phiLoop = -1;
		}
	    if(phi > (2*PI))
	    {
	    	phi = phi - 2*PI;
	    	phiLoop = 1;
	    }	
		phiBuf[phiBind++]=phi;			// put phi in buffer for viewing
		if(phiBind >= NPHI)				// resent buffer index
			phiBind = 0;
		
		phIndex = (int) (NUMSAMP-1)*phi/(2*PI); // update phi's index into correlators

		if(phiLoop == 0)				// No wrapping 
		{								// Receive one bit
			X = 0;
			for(i=0; i<NUMSAMP; i++)	// Correlate Signal with Basis Function
			{
				X += data_symbol[(NUMSAMP-1)-phIndex+i]*sin_table[32*i];		
				data_symbol[i] = data_symbol[NUMSAMP + i];
			}	
    		rBit[0] = (X >= 0) ? 1: 0;  	// Make Detection
    		nrBits = 1;
    	}
		if(phiLoop == 1)					// phi wrapped to 0
		{									// Received two bits
			phiLoop = 0;
			X = 0;
			for(i=0; i<NUMSAMP; i++)		// Correlate Signal with Basis Function
			{
				X += data_symbol[i]*sin_table[32*i];			
			}
    		rBit[0] = (X >= 0) ? 1: 0;  	// Make Detection;
    		
    		X = 0;
			for(i=0; i<NUMSAMP; i++)		// Correlate Signal with Basis Function
			{
				X += data_symbol[(NUMSAMP-1)-phIndex+i]*sin_table[32*i];		
				data_symbol[i] = data_symbol[NUMSAMP + i];
			}	
    		rBit[1] = (X >= 0) ? 1: 0;  	// Make Detection			
    		nrBits = 2;
		}
		if(phiLoop == -1)					// Phi wrapped to 2*PI
		{									// don't receive any bits
			phiLoop = 0;
			for(i=0; i<NUMSAMP; i++)
			{								// update symbol values
				data_symbol[i] = data_symbol[NUMSAMP + i];
			}
			nrBits = 0;
		}

		for(i=0; i<nrBits; i++)				// Loop over the received bits
		{
			bits[bitIndex++] = rBit[i];

	    	decodeSeq[7] = rBit[i];			// put received bit in decSeq Buffer
	    	syncTrigger = 0;
			for(j=0; j<8; j++)				// Search the last 8 bits for
			{								// frame syncronization sequence
				if(j < 8)					// mask received seq with sync seq
				{
					syncTrigger += (decodeSeq[j] == syncSequence[j]);
				}
				decodeSeq[j] = decodeSeq[j+1];
			}
			syncInterval++;
			if(syncTrigger == 8)	// If sync interval is found set frame index
			{
				if(syncInterval == 8*(SYNC_INTERVAL+1))	// Look for symbols separated
				{										//  by the sync interval
					bitIndex = 0;						// Set the frame sync point
					prev_sample2 = prev_sample;			// Use same values
					prev_sample = out_sample;			// for output if sync bit is present						
				}
				syncInterval = 0;				
			}
			TrigBuffer[tbIndex++] = syncTrigger;	// Debug buffer to look at trig
			if(tbIndex >= 200)						// Reset trig buffer index
				tbIndex = 0;
				
				
			if(bitIndex >= 8)		// If a byte is received decode it
			{	
				prev_sample2 = prev_sample;		// Update 3rd polynomial vertex
				prev_sample = out_sample;		// Update 2nd polynomial vertex
				bitIndex = 0;					// reset index into bit buffer
				out_sample=0;					// set output sample to zero
				outInc = 0;						// Reset polynomial interp index
				if(bits[7]==1)		// If negative value take twos comliment
				{
					for(j=0;j<7;j++)  // Mask bits twos compliment
					{
						bits[j] = (bits[j] == 0);
					}
				}
    			for(j=8; j<15; j++)  // Decode the bits
    			{
            		out_sample=out_sample+pow_table[j]*bits[j-8];
    			}
    			if (bits[7]==1)		// If negative change the sign and add 1*2^8
    			{
            		out_sample=-(out_sample+256);
    			}  
    			sampleBuffer[sBuffer++] = out_sample;
					if(sBuffer >= 2000)
						sBuffer = 0;   			
			}	
		}
		
    	if(decSeqNum >= NUM_BITS)	// Reset index for decoded sequence
    	{
    		decSeqNum = 0;
    	}
	}

	// Use 3 point polynomial interpolation for output values
   	output_sample((out_sample-2*prev_sample + prev_sample2)*(outInc*outInc/64-outInc)/128 
   					+ (prev_sample-prev_sample2)*outInc/64 + prev_sample2);
   	outInc++;
}


void init_sin_table()  	// Tables used to speed computation
{
	int i;
	
	for(i=0; i<96*NUMSAMP; i++)		// Create table of sin waves
	{
		sin_table[i] = sin(2*PI*i/(32*NUMSAMP));
	}
	for(i=0; i<16; i++)				// Create Table of powers of two
	{
		pow_table[i] = pow(2, i);
	}
}

void main()
{
  init_sin_table();
  comm_intr();                  	//init DSK, codec, McBSP
  while(1);                     	//infinite loop
}


 

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91免费看片在线观看| 国产性色一区二区| 久久午夜色播影院免费高清| ...av二区三区久久精品| 蜜臀久久99精品久久久画质超高清| 国产在线观看一区二区| 欧美人与性动xxxx| 亚洲欧美中日韩| 国产精品 日产精品 欧美精品| 91麻豆精品国产91久久久久久久久| 亚洲人成影院在线观看| 国产精品91xxx| 欧美大片国产精品| 五月激情综合网| 欧美三级欧美一级| 一区二区三区不卡视频在线观看 | 免费在线观看日韩欧美| 91网上在线视频| 国产精品电影院| 国产成人激情av| 久久精品亚洲乱码伦伦中文| 蜜臀久久99精品久久久久久9| 欧美日韩一本到| 亚洲午夜在线观看视频在线| 一本一本久久a久久精品综合麻豆| 久久久不卡影院| 国产一区二区美女| 久久久亚洲国产美女国产盗摄 | 欧美视频精品在线| 亚洲精品免费电影| 欧洲亚洲国产日韩| 亚洲在线观看免费| 欧美精选一区二区| 日本欧美一区二区在线观看| 欧美一区二区久久| 紧缚捆绑精品一区二区| 精品久久国产字幕高潮| 国产精品一区一区| 国产精品国产三级国产aⅴ原创| 99久久国产综合色|国产精品| 亚洲精品久久7777| 欧美日韩一卡二卡三卡| 日韩精品一二区| 久久久久久久久久久久久久久99 | 国产精品青草久久| 91无套直看片红桃| 日韩高清在线电影| 欧美va在线播放| 国产激情一区二区三区四区| 亚洲欧洲三级电影| 欧美精品在线一区二区三区| 偷窥国产亚洲免费视频 | 欧美日韩亚洲综合一区| 日韩一区欧美二区| 久久精品一区二区三区不卡牛牛| a4yy欧美一区二区三区| 亚洲一区二区三区精品在线| 日韩欧美国产三级| av网站免费线看精品| 爽好多水快深点欧美视频| 精品久久久三级丝袜| 97精品电影院| 麻豆免费精品视频| 日韩一区在线播放| 日韩视频中午一区| 成人h版在线观看| 日韩中文字幕区一区有砖一区| 久久久久久久久久电影| 欧美丝袜丝交足nylons| 国内外成人在线| 午夜久久久久久| 中文av一区特黄| 欧美本精品男人aⅴ天堂| 色综合咪咪久久| 国产成人免费在线视频| 日日夜夜免费精品| 亚洲欧美激情在线| 久久精品在这里| 日韩欧美在线网站| 在线欧美日韩精品| 不卡的av网站| 精品一区二区三区视频在线观看 | 久久精品二区亚洲w码| 国产精品久久久久久一区二区三区 | 免费成人av在线| 一区二区欧美精品| 国产精品视频在线看| 日韩欧美一区二区久久婷婷| 欧美亚洲综合一区| 色综合久久久久综合| 国产高清精品在线| 久久99精品久久久久| 香蕉久久一区二区不卡无毒影院| 国产精品国产三级国产有无不卡 | 国产999精品久久久久久| 欧美bbbbb| 日韩激情中文字幕| 亚洲一区二区在线免费看| 18欧美亚洲精品| 中文字幕在线不卡一区二区三区| 欧美电影免费观看高清完整版在线 | 色激情天天射综合网| 成人午夜av影视| 国产精品一卡二| 国产成人精品一区二区三区四区 | 免费观看91视频大全| 天天综合色天天| 五月婷婷综合在线| 亚洲第一二三四区| 五月天网站亚洲| 日韩va亚洲va欧美va久久| 亚洲五码中文字幕| 亚洲一区二区在线免费观看视频| 亚洲精品国产高清久久伦理二区| 日韩毛片高清在线播放| 亚洲欧美国产毛片在线| 亚洲激情图片qvod| 亚洲一区精品在线| 午夜精品成人在线| 日本特黄久久久高潮| 免费在线观看视频一区| 国产资源精品在线观看| 国产99一区视频免费| 波多野结衣在线一区| 91视频一区二区| 欧美日韩五月天| 日韩一区二区三区电影 | 亚洲免费三区一区二区| 亚洲一区在线视频观看| 舔着乳尖日韩一区| 国产呦萝稀缺另类资源| 福利一区二区在线观看| 99热精品一区二区| 欧美日产国产精品| 久久午夜免费电影| 亚洲男帅同性gay1069| 丝袜亚洲精品中文字幕一区| 美国毛片一区二区三区| 成人激情图片网| 精品视频资源站| 久久久久久久网| 亚洲色图视频网| 蜜桃传媒麻豆第一区在线观看| 国产精品一区二区在线播放| 色婷婷激情综合| 精品国产1区2区3区| 自拍偷拍亚洲欧美日韩| 婷婷中文字幕综合| 粉嫩av一区二区三区在线播放| 在线一区二区观看| 国产亚洲一区字幕| 性做久久久久久免费观看| 国内成人免费视频| 欧美日韩电影一区| 中文字幕第一区二区| 首页国产丝袜综合| 91女神在线视频| 欧美电影免费观看高清完整版在线| 中文字幕日本不卡| 久久99国产精品麻豆| 欧美最猛性xxxxx直播| 欧美经典三级视频一区二区三区| 亚洲一区在线观看免费| 丁香婷婷综合激情五月色| 日韩午夜激情电影| 亚洲国产精品久久人人爱| 国产一区亚洲一区| 欧美精品免费视频| 国产精品卡一卡二| 精品亚洲免费视频| 欧美巨大另类极品videosbest| 国产精品久久看| 国产乱子伦视频一区二区三区| 67194成人在线观看| 亚洲欧美偷拍三级| 国产成人av福利| 91精品国产综合久久久久久久| 亚洲视频1区2区| 北条麻妃一区二区三区| 国产亚洲福利社区一区| 久久99国产乱子伦精品免费| 欧美日韩三级一区| 亚洲国产一区二区三区青草影视| 成人精品免费网站| 欧美激情一区不卡| 国产成人av一区| 日本一二三四高清不卡| 国产一区不卡精品| 久久久www成人免费无遮挡大片| 日韩电影在线观看网站| 欧美男男青年gay1069videost| 亚洲欧美激情插 | 久久久www成人免费毛片麻豆| 日韩中文字幕一区二区三区| 欧美日韩激情一区二区三区| 亚洲制服丝袜av| 欧美日韩视频一区二区| 亚洲国产精品麻豆| 91精品国产日韩91久久久久久| 天天色天天爱天天射综合|