Pitch class profiling
I know this is an old thread, but for reference for future enthusiasts in this field:

The equation for the full PCP algorithm as described by Fujishima is as follows:

$$ PCP(p)=\sum_{ls.t.M(l)=p}^{l}||X(l)||^2$$

$$M(l)=\mathrm{round}\left[12\log_2 \left(\dfrac{f_\text{s} \ l}{N f_\text{ref}} \right) \right]\operatorname{mod} 12 $$

The confusion that OP has is in regards to the 2nd equation:

$N$ is how many samples are used to calculate the FFT, or typically known as the FFT size.  Note that a larger $N$ (more samples, longer time) would mean higher resolution of the FFT.

$f_\text{s}$ is the sampling frequency of the audio file you are processing.  Typically this is  44 100Hz.

$f_\text{ref}$ is the reference frequency for the pitch class you are trying to match.  This is typically a set of 12 frequencies, representing the fundamental frequencies of the 12 semitones of a classical keyboard.  For your reference, they are
[16.35, 17.32, 18.35, 19.45, 20.60, 21.83, 23.12, 24.50, 25.96, 27.50, 29.14, 30.87], starting from C0 to B0.

To understand this equation better, the collective term of $f_\text{s} l/N$ is equivalent to converting the FFT bins into the actual frequency that bin represents.  $l$ here is just the bin counts for the FFT output.  So for every bin of the FFT, the associate frequency can be calculated with this term.

Because every octave is effectively a double in frequency to the previous octave (if C0 is 16.35Hz, then C1 = 2*C0 = 32.70  C2 = 2*C1).  So to reverse this, we take the $\log_2$ of the calculated frequency from the previous step.

Now to the first equation, note the summation if for all $l$, such that $M(l) = p$.  This means for all of the different pitch classes p (0-11), we must only use bins in the FFT such that $M(l) = \textrm{the pitch classes}$.  To find such conditions, we sweep the fref for all frequencies in the FFT so we find the frequencies that contributes the most to the individual pitch classes.

Note that the $M(l)$ equation should not give you a negative number.  The reason for this is the FFT creates both positive and negative frequencies.  But for all real signals (such as audio signals), the negative frequencies is just a reflection of the positive frequencies.  You only really need to deal with the positive frequencies, which resides in the first half of the output from the FFT.  Or you can use a rFFT (such as the one in python - numpy) algorithm that specifically deals with real signals, and will only return to you the positive frequencies.

If you were to implement this algorithm, you would do the following:


Pick a pitch class profile (lets say you want to look at $PCP(0)$ to find all notes that falls under the musical C)
Now, according to the 1st equation, you need to find all $l$ such that $M(l) = 0$
You go to the 2nd equation, going through all the bins of your FFT (which is l).  You also set your $f_\text{ref}$ to be the reference frequency for the PCP bin you're after (at this case, since we are looking for C, we can set the $f_\text{ref}$ to 16.35Hz).
Find all values of $l$, such that $M(l) = 0$.  Go back to the 1st equation, now with the subset list of $l$, take the magnitude of the FFT at those specific bins ($l$), to find the final sum for pitch class 0.