Пример #1
0
func (m *OFDM) Fft(inputPin1 gocomm.Complex128AChannel) {
	/// Read your data from Input channel(s) [inputPin1]
	/// And write it to OutputChannels  [outputPin1]

	outputPin1 := m.Pins["outputPin1"].Channel.(gocomm.Complex128AChannel)
	iters := 1
	for i := 0; i < iters; i++ {
		chData := <-inputPin1
		iters = chData.MaxExpected
		tsamples := chData.Ch
		/// Do process here with chData

		var outData gocomm.SComplex128AObj
		outData.Ch = dsp.ExtFFT_C(tsamples, m.NPoint)

		/// copy meta
		outData.MaxExpected = chData.MaxExpected
		outData.Ts = chData.Ts
		outData.TimeStamp = chData.TimeStamp
		outData.Message = chData.Message

		outputPin1 <- outData
		iters = chData.MaxExpected
	}

}
Пример #2
0
func (m *MPChannel) Channel(inputPin0 gocomm.Complex128Channel) {
	/// Read your data from Input channel(s) [inputPin0]
	/// And write it to OutputChannels  [outputPin0]

	outputPin0 := chipset.ToComplexCH(m.Pins["outputPin0"])
	var IdealChObj gocomm.SComplex128AObj

	iters := 1
	for i := 0; i < iters; i++ {
		chData := <-inputPin0
		iters = chData.MaxExpected
		/// Do process here with chData

		outData := m.ChannelFn(chData)
		/// coeff attempt to send
		IdealChObj.Ch = m.Coeff
		IdealChObj.Ts = chData.Ts
		IdealChObj.TimeStamp = chData.TimeStamp
		IdealChObj.Message = chData.Message
		IdealChObj.MaxExpected = chData.MaxExpected
		//fmt.Printf("\n Want to broadcast %#v to %#v", IdealChObj, coeffPin)
		///

		// select {
		// case coeffPin <- IdealChObj:
		// 	// fmt.Printf("\n%f : sent message %v", IdealChObj.TimeStamp, IdealChObj.Ch)
		// default:
		// 	// fmt.Printf("\n%f: no message sent", IdealChObj.TimeStamp)
		// }
		outputPin0 <- outData
	}

}