I want to shift the response phase of an audio signal (float array, length N, value range -1..1). I'm about using Fast Hartley Transform to transform it to the frequency-domain, process phase shift, then convert back to the time-domain and output the result.
I'm now can do the Hartley transform, and I also can calculate the phase of kth bin:

real(k) = (x(k) + x(-k))/2
imag(k) = (x(k) - x(-k))/2
phase(k) = atan2(imag(k), real(k))

I want to shift the phase(k) by an α degree. What should I do?


1 Answer 1


I think your notation is a bit fishy but I'll use it. Assuming that your $\text{phase}(k)$ calculation is correct, do a complex multiplication of $\text{real}(k) + i\ \text{imag}(k)$ by $e^{i\alpha} = \cos(alpha) + i\sin(alpha)$. That can be done using four real multiplications and a few add/sub. Then you need to reverse the process of how you obtained $\text{real}(k)$ and $\text{imag}(k)$:

$$x(k) = \text{real}(k) + \text{imag}(k)$$ $$x(-k) = \text{real}(k) - \text{imag}(k)$$

Finally retransform.

  • $\begingroup$ Ah, x(-k) is actually x(N-k), and the formula is from a document, I'm not sure about it much. Anyway, thanks for your help, I've successfully shifted the phase. I test the result by substract the phase value before and after, and it's alpha. $\endgroup$
    – MPhuc
    Jun 25, 2015 at 9:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.