danciac Posted May 4, 2021 Report Share Posted May 4, 2021 Hi all, I want to add coloured noise to various blocks in my PLL system. Upon checking the manual I found this: In order to get colored noise, the output of the function gauss_rand can be filtered using appropriate transfer functions. I am new to SystemC/AMS and was wondering if any of you could provide the simplest example on how to implement that filter on the gauss_rand function output. Thanks! Quote Link to comment Share on other sites More sharing options...
maehne Posted May 19, 2021 Report Share Posted May 19, 2021 You are referring to section 8.2.2.2 "Modeling noise in the time domain" in the SystemC AMS User's Guide. This document explains in section 5.3.2 "Laplace transfer functions" how to instantiate a Laplace transfer function within a TDF primitive module to filter an input signal. If you want to generate transient coloured noise, all you have to do is to specify the coefficients for that transfer function according to the characteristic of the kind of noise you want to model (see, e.g., Wikipedia as a starting point). Then, instead of feeding the input samples to the LTF functions, you would feed the samples generated by calls to function gauss_rand() to the LTF and add the return value to your signal as your coloured noise contribution. Note that std::rand() gives no guarantees on the quality of the generated random numbers. Since C++'11, there are better ways to generate pseudo-random numbers satisfying various distributions. 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.