Envelope Detection using a Hilbert transformer method (PSoC5)

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
lock attach
Attachments are accessible only for community members.
odissey1
Level 9
Level 9
First comment on KBA 1000 replies posted 750 replies posted

This project demonstrates Envelope Detection using a Hilbert transformer method.

The amplitude modulated sinusoidal carrier signal is sampled by DelSig_ADC, digitally processed to extract the AM envelope and outputted using VDAC8. 

HilbertEnvDetector_VDAC_01b_upload_Workflow_A1.png

The envelope extraction is done using the Hilbert transformer method, utilizing the Filter component. Both channels of the Filter are preset with custom coefficients  to form 63-point Hilbert band-pass filter, (0.1 to 0.9) x (Fs / 2), producing
analytical (vector) signal from the ADC data. Both channels are identical, except that Channel_A has added Hilbert phase +45 deg, and Channel_B has added phase of -45 deg, producing orthogonal vector (x,y), which magnitude (length) is proportional  to the AM envelope amplitude.

The Filter coefficients are calculated using IowaHills Hilbert Filter Designer v3.0, which is available for download.

The vector length is calculated by CPU using CORDIC algorithm. To speed up processing, the procedure is restricted to only vector length (atan is ignored), and the number of iterations is reduced down to 6 (from 14), taking 58 clocks.

Optional custom Low Pass (moving average) filter can be applied to reduce step transition effects from the Hilbert filter.

The resulting envelope is sent to the VDAC8 and observed by o-scope.

Project includes optional test AM signal generator, which produces amplitude modulated signal at carrier frequency 23.4kHz. The signal generator is comprised of WaveDAC8, which is set to switch between the two Sine waves of different amplitudes, and PWM, which controls the AM period and duty cycle.

 

Credits:
   The Filter custom coefficients were produced using IowaHills Hilbert Filter Designer v3.0 by Iowa Hills Software LLC (IowaHills.com)

Uses:
   Project uses optional custom component MovingAverage Filter (included into the project) : MAFilter_v0_0

/odissey1

Figure 1. Project schematic. The Moving Average filter  (Filter_1) is optional. Capacitor C_13 is a KIT-059 onboard capacitor, connected to Pin 0[3].

HilbertEnvDetector_VDAC_01b_upload_ADC_B.png

Figure 2. Optional signal generator, producing amplitude modulated signal at carrier frequency 23.4kHz. The  WaveDAC8 is set to switch between the two Sine waves of different amplitudes. PWM controls the AM period and duty cycle.

HilbertEnvDetector_VDAC_01b_upload_SignalGen_A.png

Figure 3. Project annotation drafted using PSoC Annotation Library v1.0 . ADC is configured in differential mode. Capacitor C1 decouples signal generator from the ADC. Resistor R1 provides DC offset of 1.024V for ADC input (-). The signal generator is optional, it is not needed if an external AM signal is available.

HilbertEnvDetector_VDAC_01b_upload_KIT-059_A.png

Figure 4. IowaHills Hilbert Filter Designer v3.0. Filter coefficients for Channel  A (Phase Add +45deg) are shown at the right pane. Channel B calculations are the same, except it uses Phase Add of -45deg (not shown). 

Hilbert_n63_c0.5_w0.8_45deg.png

Figure 5. Filter settings for Channel A. Filter coefficients are directly copied from the Hilbert Filter Designer. 

Channel_A_n63_c0.5_w0.8_45deg.png

Figure 6. Scope traces: Blue - input signal, Yellow - envelope output, Cyan - reference. AM amplitude 1.0V, amplitude modulation 50%. Carrier frequency 23.3 kHz, AM frequency 0.583 kHz (PWM Period=40).  The output is delayed by the Filter by (63-1)/2 samples.

HilbertEnvDetector_VDAC_01b_upload_PWM40_0.5-1.0V_A.png

Figure 7. Scope traces: Blue - input signal, Yellow - envelope output, Cyan - reference. AM amplitude 1.0V, amplitude modulation 50%, AM frequency 2.33 kHz (PWM Period=10). Carrier frequency 23.3 kHz. 

HilbertEnvDetector_VDAC_01b_upload_PWM10_0.5-1.0V.png

Figure 8. Scope traces: Blue - input signal, Yellow - envelope output, Cyan - reference. AM amplitude 0.012V, amplitude modulation 50%, AM frequency 2.33 kHz (PWM Period=10). Carrier frequency 23.3 kHz. The output (Yellow trace) is digitally scaled up by 32 to match 8-bit scale of VDAC8.

HilbertEnvDetector_VDAC_01b_upload_PWM10_4-12mV.png

 

 

1 Reply
Len_CONSULTRON
Level 9
Level 9
Beta tester 500 solutions authored 1000 replies posted

odissey,

Kudos!

Len
"Engineering is an Art. The Art of Compromise."
0 Likes