• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

cli/H20-Sep-2021-1,4771,149

img/H03-May-2022-

lv2ttl/H20-Sep-2021-8376

src/H20-Sep-2021-494368

COPYINGH A D20-Sep-202117.7 KiB340281

MakefileH A D03-May-20223.4 KiB12186

README.mdH A D20-Sep-20212.8 KiB8258

git2lv2.mkH A D20-Sep-20211.4 KiB4429

README.md

1phaserotate.lv2
2===============
3
4phaserotate.lv2 is an audio phase rotation plugin.
5
6Phase shift vs. time shift
7--------------------------
8
9Time shifting delays a signal by an **absolute** value in seconds (or samples).
10While phase shift uses a **relative** value, a fraction of the wave-length.
11
12When phase shifting a signal, different components of the signal are delayed
13differently depending on their frequency.
14
15The following figure shows an oscilloscope display of two sine-waves with different
16frequencies that play concurrently (green and blue) and respective shifted
17versions of each signal (red, violet).
18
19The left images shows a phase shift by 90deg (1/4 wave-length).
20Note that the time-delay differs: The sine-wave with the lower frequency (top, red)
21is delayed further compared to the higher pitched sine-wave (bottom, violet).
22
23In the right image both sine-waves are delayed by the same time. Note how this
24results in a different phase shift, as both waves differ in their wavelength.
25
26![](https://github.com/x42/phaserotate.lv2/blob/master/img/time-vs-phase-delay.png "Time vs Phase delay")
27
28Due to the periodic nature of the signal, a phase shift of +180 deg is equivalent to
29a shift of -180 deg. The signal is *rotated* around the unit circle on the complex plane.
30
31Phase rotation
32--------------
33
34The interesting aspect is that phase rotation does not alter the sound of the signal
35nor the loudness. However changing the phase vs. frequency relationship between lower
36and upper harmonics changes the waveform and can affect where the digital peak occurs.
37
38For this reason phase rotation is commonly used by radio stations to reduce
39the signal peak and make the signal more symmetrical. Phase rotation circuits are
40also used during mastering to increase headroom. This allows to increase gain and
41further compress the signal.
42
43Caveat
44------
45
46By nature of the process phase-rotation affects transient response. Similar to a
47linear-phase EQ, there is also pre-ringing. Use this effect with caution because
48you are about to become a casualty in the *loudness-war* against quality.
49You have been warned.
50
51CLI
52---
53
54In addition to the plugin, there is a command-line tool that can analyze an
55audio file, and find the phase shift which will result in a minimum peak.
56
57This is for offline analysis and offline processing only, and not installed
58by default.
59
60Install
61-------
62
63Compiling phaserotate.lv2 requires the LV2 SDK, fftw, gnu-make, and a c-compiler.
64
65```bash
66git clone git://github.com/x42/phaserotate.lv2.git
67cd phaserotate.lv2
68make
69
70ln -s `pwd`/build ~/.lv2/phaserotate.lv2
71#sudo make install PREFIX=/usr
72
73cd cli
74make
75#sudo make install PREFIX=/usr
76./phase-rotate --help
77```
78
79Note to packagers: The Makefile honors `PREFIX` and `DESTDIR` variables as well
80as `CFLAGS`, `LDFLAGS` and `OPTIMIZATIONS` (additions to `CFLAGS`), also
81see the first 10 lines of the Makefile.
82