# Hilbert Transform, filters - two different phase graphs

Relationship between magnitude response and phase response for minimum phase is: Phase plots are obtained from Hilbert transform of real magnitude values. Input to Hilbert transform was a vector (array) of real magnitude values in dB. Magnitude vs. frequency (Fig. 1.) is a raised-cosine function defining a Mesa filter with plateau.

I obtained phase values in two ways. In Fig. 2. the resulting phase plot (phase from the previous formula, not the phase from analytic signal) is obtained from SciLab using command x = -hilbert(xr), printing imag(x). Variable xr is vector holding magnitude values. In Fig. 3. the phase plot (phase from the previous formula, not the phase from analytic signal) is obtained from C implementation of Hilbert transform taken from ht.c file on the web. Hilbert transform here is implemented as convolution and the values are in xh[i].

Although similar, the phase plots on Fig. 2. and Fig. 3. are quite different. Any insights why I am getting two different graphs of phase? • The hilbert command in Scilab returns the analytic signal associated with xr, not its Hilbert transform. Taking imag(x) should produce the Hilbert transform, but that's not the phase you're plotting. Can you be more explicit about how you're generating the second plot? i.e. what Scilab commands did you use? I suspect the different you're seeing is because of different implementations of the Hilbert transform. ht.c uses an FIR filter. Perhaps Scilab uses an FFT-based approach (that's what the sole reference above says)? – Peter K. Jul 3 '15 at 15:36
• @PeterK. I am aware that SciLab's hilbert command produces analytic signal. Hence, imag(x) is my Hilbert transform, as I mentioned in my question, and I plot that. As I wrote, I use x=-hilbert(xr) in SciLab. I am suspecting that SciLab uses "FFT->phase shift->IFFT method for Hilbert transform, but not sure. – Nebojsa Jul 3 '15 at 16:11
• Umm. Plotting the imaginary part isn't the same as plotting the phase. You would have to use use phasemag (help.scilab.org/doc/5.3.3/en_US/phasemag.html) to get the magnitude and phase from your complex number. – JRE Jul 3 '15 at 16:29
• @JRE Imaginary part of x is exactly Hilbert transform. Real part is equal to the input real sequence. I am not talking here about the phase of the analytic complex signal, but rather about the phase obtained from my first equation in the question. – Nebojsa Jul 3 '15 at 17:24
• ht.c returns magnitude and phase. SciLab Hilbert returns real and imaginary. You have to convert from complex to polar and take the angle to get phase. That is what SciLab phasemag does. – JRE Jul 3 '15 at 19:38
{"ft_lang_label":"__label__en","ft_lang_prob":0.88600624,"math_prob":0.86002594,"size":1834,"snap":"2020-34-2020-40","text_gpt3_token_len":439,"char_repetition_ratio":0.14972678,"word_repetition_ratio":0.08108108,"special_character_ratio":0.22628134,"punctuation_ratio":0.1368715,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9948301,"pos_list":[0,1,2,3,4],"im_url_duplicate_count":[null,3,null,3,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2020-08-07T16:04:50Z\",\"WARC-Record-ID\":\"<urn:uuid:a6c97e7e-5466-43a2-b4a0-f4811b2211be>\",\"Content-Length\":\"146776\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:9d1b7469-e136-4233-afcf-4b5b69534c4e>\",\"WARC-Concurrent-To\":\"<urn:uuid:c9664fee-68a4-420c-a9f7-ac2895d83fee>\",\"WARC-IP-Address\":\"151.101.1.69\",\"WARC-Target-URI\":\"https://dsp.stackexchange.com/questions/24503/hilbert-transform-filters-two-different-phase-graphs\",\"WARC-Payload-Digest\":\"sha1:XXWUKT2CZLXEQ66FRQKNMEXA3QK3L3VP\",\"WARC-Block-Digest\":\"sha1:SZ7T67KMVIQWFSKWNGVBRDZU4CEX2ZCR\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2020/CC-MAIN-2020-34/CC-MAIN-2020-34_segments_1596439737204.32_warc_CC-MAIN-20200807143225-20200807173225-00373.warc.gz\"}"}