dakupoto Posted June 5, 2013 Report Share Posted June 5, 2013 Could some SystemC-AMS guru please shed some light as to how one might implement an "integrator over sample period" , as used in demodulation, say BPSK. I have experimented with LSF integrator object, as well as some TDF modules of my own, but it has not helped. Any hints, suggestions would be of immense help. Thanks in advance for your help. Quote Link to comment Share on other sites More sharing options...
maehne Posted June 5, 2013 Report Share Posted June 5, 2013 Dear Amal, there are several possibilities to create an integrator model, which state variable can be reset after a certain period. You can, e.g., model the integrator using a LTF in numerator denominator for H(s) = 1 / s using the sca_tdf::sca_ltf_nd class. When calling your instance of the LTF function, you can not only pass the coefficients of the LTF in form of sca_vector variables, but also an sca_vector, which will hold the single state variable. Now, you have to only determine, when to reset this state vector to zero. Assuming constant time step in a SystemC AMS 1.0 TDF model, you can simply use an integer counter and modulo operation and do the reset when the operation results in zero. Deciding on the reset based on the current time and chosen sample period of the continiuos time signal complicates things slightly: In that case, I would use a member variable to keep track in which period you were in the previous activation. If it differs from the period of the current activation, you have to do the reset. The reset techniques also work if you model your integration using state space equations (advantage: you exactly know which state variable has which index in your state vector) or by explicitly calculating an Euler or Trapezoidal integration step at each activation on processing(). Best regards, Torsten Quote Link to comment Share on other sites More sharing options...
dakupoto Posted June 6, 2013 Author Report Share Posted June 6, 2013 Hello Torsten, Thanks for your hints. I had not thought of using the LTF class that you have mentioned in your reply. I will try these out and see what happens. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.