I am trying to turn lights on base on frequency of my audio input.
Are these real sounds like music?
If so it is very difficult to do this using software alone. Much easier is to use an MSGEQ7 chip, or two if you want stereo.
You can get just the chip or you can get it on a board. msgeq7-arduino-tutorial
Otherwise if you want to go the software route then look up the FFT function. There are a couple of libraries that do this, but using them is not a beginners project.