Reconstruct a sampled signal with ZOH

Hi all!
I have a simple question; i am sampling a signal and then storing the samples in Matlab. Now i want to correctly reconstruct the original signal for example with the Zero order hold, how can i do this? Is there an appropriate function? I found only d2c, but it doesn't seems that it takes directly the samples, but a model in z transform of the system! Thanks in advance.

 Risposta accettata

Star Strider
Star Strider il 23 Mag 2016
Systems can be interconverted between discrete-time and continuous-time representations (what the d2c function does), but not signals, at least not in computers.
The signal will remain a sampled signal in your computer because that is the only way signals can be represented in computers. (It will never be a continuous-time signal.) Your signal was likely sampled using a zero-order-hold. Converting it to a continuous-time signal would require that you pass it through an appropriately-designed digital-to-analog converter (DAC). Sound cards do this all the time.
There are practical limits to signal reconstruction. The original analog-to-digital conversion characteristically uses a hardware anti-aliasing filter designed to remove all frequencies above the Nyquist frequency (one-half the sampling frequency), so all frequencies above the Nyquist frequency will be lost.
Even if the highest frequency in your signal is well below the Nyquist frequency, exactly reconstructing your signal would likely not be possible due to the inherent inaccuracies involved in sampling and reconstructing it.
There is a substantial literature on digital-to-analog conversion, so I will not even attempt to discuss the details here.

4 Commenti

Alessandro Russo
Alessandro Russo il 23 Mag 2016
Modificato: Alessandro Russo il 23 Mag 2016
Yes sure, i know the basics of signal conversion in theory, the problem is that from the samples i get after the ADC operations, i get an incorrect signal even if i respect Nyquist; i am sending sinusoids from a function generator, and acquiring them with a Cortex microcontroller, then i send the values to the pc (sampling at 500 Hz). But i see in Matlab the correct signal only if it is at 100 Hz or even below, instead of until 250 Hz. So i thought that probably i am doing something wrong or missing in Matlab, that the hardware maybe should do before. Maybe it could be just the anti aliasing filter not implemented in the hardware? Consider that the ADC in the microcontroller probably just uses the successive approximations conversion and nothing else, so maybe i should implement a lowpass filter by myself.
Definitely implement the hardware anti-aliasing lowpass filter. If your sampling frequency is 500 Hz and you do not implement a 250 Hz hardware anti-aliasing filter prior to sampling, you will of course get aliased signals in your sampled signal.
I would use a Bessel-Thompson design because its maximally-flat frequency response will produce the least phase distortion of any filter design. The Signal Processing Toolbox besself function will give you a continuous-time transfer function, but you would then have to realise it in hardware.
A useful site for realising a Bessel filter in hardware is Analog Filters for Data Conversion from The Scientist and Engineer's Guide to Digital Signal Processing by Steven W. Smith, Ph.D. (In the free downloadable PDF, see pages 50-51.) The code for calculating the component values would be trivial to write. (They’re hand-calculator calculations, but writing code to calculate them reduces the possibility of errors.) You could easily breadboard this filter, and the frequencies involved mean that you could use inexpensive op-amps such as the 741.
Thanks a lot!
My pleasure!
I’ve done a lot of biomedical signal processing, so your question is in an area of my particular interest.

Accedi per commentare.

Più risposte (0)

Tag

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by