基于DSP的陣列聲波信號采集與處理系統設計
④ 作為DSP與主CPU之間的通信接口
主CPU的命令要傳給DSP,八個DSP最后處理過的數據也要傳給主CPU,因此,在CPLD中設計了一個同步串口。設計此串口要注意的是當DSP向主CPU傳送數據時八個DSP不能發生沖突。下面的VHDL程序是本設計中對這一問題的解決,其中bfsx1~bfsx8是DSP1~DSP8的發送幀同步脈沖,bdx1~bdx8是DSP1~DSP8的緩沖串行口數據發送端發送的數據,fsx、dx是從CPLD輸出的發送幀同步脈沖和發出的數據。
fsx= bfsx1 and bfsx2 and bfsx3 and bfsx4 and bfsx5 and bfsx6 and bfsx7 and bfsx8;
a1= ( not bfsx1)and bdx1; a2= ( not bfsx2)and bdx2;
a3= ( not bfsx3)and bdx3; a4= ( not bfsx4)and bdx4;
a5= ( not bfsx5)and bdx5; a6= ( not bfsx6)and bdx6;
a7= ( not bfsx7)and bdx7; a8= ( not bfsx8)and bdx8;
dx= a1ora2ora3ora4ora5ora6ora7ora8;
DSP編程
在DSP內要通過編程實現對數據的如下處理:
①對數據進行平均運算
這是一個對所有數據求平均值的運算,此平均值即為噪聲平均值的二倍。
評論