예제 #1
0
파일: ofdmlink.go 프로젝트: postfix/gocomm
func main() {

	N := 2048
	begin := time.Now()
	var ofdm customchips.OFDM
	ofdm.InitializeChip()
	ofdm.NPoint = N

	// fmt.Printf("\n OFDM = %v", ofdm)
	/// Input
	inCHA := gocomm.NewComplex128AChannel()
	// inCH := gocomm.NewComplex128Channel()
	var dataArray gocomm.SComplex128AObj

	x := sources.RandNCVec(N, 1)
	dataArray.Ch = x
	dataArray.MaxExpected = 1
	inCHA <- dataArray
	go ofdm.Ifft(inCHA)
	go ofdm.Fft(ofdm.PinByName("outputPin0").Channel.(gocomm.Complex128AChannel))
	outCHA := ofdm.PinByName("outputPin1").Channel.(gocomm.Complex128AChannel)
	data := <-outCHA
	/// Analyse
	fmt.Printf("\nX=%f", x[0:16])
	fmt.Printf("\nOutput=%f", data.Ch[0:16])
	// xcap := dsp.ExtFFT_C(data.Ch, N)
	// fmt.Printf("\nXcap=%f", xcap[0:16])

	fmt.Printf("\nTime Elapsed : %v\n", time.Since(begin))
}
예제 #2
0
파일: cdmachip.go 프로젝트: postfix/gocomm
func (m *CDMA) DeSpread(inputChipsSamples gocomm.Complex128Channel) {
	/// Read your data from Input channel(s) [inputChipsSamples]
	/// And write it to OutputChannels  [outputSymbol]

	outputSymbol := m.Pins["outputSymbol"].Channel.(gocomm.Complex128Channel)
	OutCH := gocomm.NewComplex128AChannel()
	go gocomm.Complex2ComplexA(inputChipsSamples, OutCH, m.GetSF())

	iters := 1
	for i := 0; i < iters; i++ {
		vecdata := <-OutCH
		iters = vecdata.MaxExpected
		/// Do process here with chData
		outData := m.DeSpreadFn(vecdata)
		outputSymbol <- outData

	}

}
예제 #3
0
파일: cro.go 프로젝트: postfix/gocomm
func (t *TwoPinProbe) ProxyPin(input gocomm.Complex128AChannel) gocomm.Complex128AChannel {
	t.inputPin = input
	t.ProbedPin = gocomm.NewComplex128AChannel()
	t.outputPin = gocomm.NewComplex128AChannel()
	return t.outputPin
}