I'm new to Matlab/Simulink and would like to convert the continuous system below to discrete for eventual conversion to C code. Matlab has a c2d function, but I don't know how to apply it to a simulink system. The c2d function requires the system to be in transfer function or state-space form, neither of which I know how to convert the diagram to.
So any ideas on how to use the c2d function in this situation? Or should I use something like Tick's rule to replace the integrators? Any other methods?
Here is the simulink diagram in question. It's purpose is to determine the fundamental of a sine wave. With further stages, it can also extract higher harmonics if present. The scope is connected to the fundamental frequency estimate. The system needs to be converted to 44.1Khz sampled system.
See this paper for more info: http://ijcsi.org/papers/IJCSI-8-5-1-360-365.pdf