Пример #1
0
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
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
func (t *TwoPinProbe) ProxyPin(input gocomm.Complex128AChannel) gocomm.Complex128AChannel {
	t.inputPin = input
	t.ProbedPin = gocomm.NewComplex128AChannel()
	t.outputPin = gocomm.NewComplex128AChannel()
	return t.outputPin
}