why is some other values given in datasheet.
The datasheet is giving minimum values which give the performance claimed in the datasheet. (Some datasheet values may be given with other values for \$C_i\$ and \$C_o\$, and it will tell you this.)
If you use smaller caps, ripple and noise will be higher than specified.
With a standard regulator like the 7805, there is no performance penalty to using larger caps than specified, other than the slower rise time on the rails. Some devices you may wish to power from the regulator won't be happy with a slowly-rising power rail, while others don't much care.
Obviously using caps larger than necessary has costs. Bottom line, you should engineer your cap values, not guess at them.
LDO type regulators generally will actually fail if you guess incorrectly on the cap type and value.
Is it really possible to use the 7805 without any capacitors at all if I am using a DC 9v battery as input?
You can get away with it, but whether it succeeds or not depends on conditions surrounding the regulator.
In your particular case, \$C_i\$ is cheap insurance against oscillation due to the input supply and ground impedances. A 9V battery has a fairly high impedance due to the small cell size and the number of them in series. This opens you up to ground bounce getting back to the input, which effectively closes a feedback loop on the system, which is a prerequisite for oscillation.
Other systems might not need \$C_i\$, such as because the regulator is connected to a nearby unregulated supply with its own output cap. That cap may suffice to decouple the regulator's input, too.
The story for \$C_o\$ is similar: if there is already a nearby downstream cap, you might not need a separate one for the regulator.
Bottom line, test under all the conditions you will need the system to operate under. Even when one of these caps isn't strictly required, it may improve performance.
Is there some formula for calculation which can be done to determine the values of the capacitors? If yes, where I can find it?
Any electronics text book. The Art of Electronics third edition just became available a few days ago. It certainly gives equations for capacitor voltage vs current and such.
Is it correct to assume that an ideal (theoretical) PSU for audio applications should produce a constant voltage regardless of load variations (i.e. it is a voltage source)?
Yes. An ideal power supply for any application should be an ideal voltage source, which has a constant voltage.
In practice, what are acceptable levels of supply voltage variation due to transients in an audio application (in percentage of Vs or mV)?
This is dependent on your application. You have to evaluate your desired noise/distortion, the power supply rejection of the audio components you are using, and the way the circuit is constructed. 0.1% power supply variation translates to a -60dB noise floor, which might be sufficient.
What is the correct approach to reduce these V swings? Should I place a capacitor on the INPUT or OUTPUT of the regulator? Is there a rule of thumb/calculation for the required capacitance? Are electrolytic capacitors OK, or should I use polyester or tantalum caps (i.e. something with a lower ESR)?
Probably both. You should have both bulk capacitance on the output and low-ESR decoupling caps in close proximity to all active chips (op-amps, ADCs, DACs, etc). And some more capacitance on the input certainly wouldn't hurt.
Typically, you might use large electrolytics for bulk capacitance, and low-ESR ceramics for faster decoupling. Again, how much you need depends on the magnitude and characteristics of the wiggles on the supply rail. Also, carefully read the datasheet of the regulator and make sure you are within its comfortable operating region: the regulator has a response speed and current limits, as well as input ripple rejection specs.
Best Answer
The input capacitance value is not critical. What is critical is that you have some way of preventing the input voltage from dipping during operation over a wide frequency band.
The connection between the power source(battery, generator, AC power, etc) and the regulator input will have some inductance L. In a linear regulator current passes from the input of the regulator, goes through a pass element (usually a BJT, MOSFET, or IGBT), and then flows to the load. The input and output current are typically about equal except for a small amount of extra input current used to run the regulator internal circuitry (reference, error amp, gate drive).
Suppose that the regulator input current increases at a rate of di/dt (due to the load current changing). Then without any input capacitance the input voltage to the regulator would dip by an amount V_dip = L * di/dt. Clearly if the voltage dips too much then the regulator will stop working and the output load voltage would drop.
The datasheet will usually recommend a minimum required capacitance on the input, but you can always use more. Ceramic capacitors tend to work well over a wide frequency band but have lower capacitance values. Electrolytic capacitors have larger values but work only at lower frequencies. Typically a combination of both types is used to get both high capacitance and wide frequency operation.
Linear regulators typically have an error amplifier and pass transistor inside of them. Both of those components have limited bandwidth. If the output current changes too rapidly then the regulator will not be able to adjust to the demand changes quickly enough and the output voltage may dip.
The amount of output dip at frequencies much higher than the regulator bandwidth is approximately dV = I/(2 * pi * f * C). For example if you had a regulator with a bandwidth of 100kHz, and you were running some digital electronics that drew 100mA spikes at 1MHz and had a 0.1uF output capacitor then the output ripple would be 100mA/(2*pi*1MHz * 0.1uF) = 15.9mV peak.
Typically you would try to pick a capacitance that leads to an acceptable ripple voltage (using the above equation) at the peak load current at the frequency corresponding to the regulators bandwidth given in the datasheet.
Another factor to consider for the output capacitor is stability. The error amplifier in a linear regulator typically uses feedback and can oscillate if too much or too little capacitance is used. Many linear regulators are stable with a wide range of output capacitances. The datasheet will often specify that the capacitance must be below or above a certain value for stable operation.
You cant really calculate how much capacitance is required for stability without knowing the characteristics of the error amplifier (phase and gain margin vs. frequency). Since the manufacturer often doesn't tell you that information you sort of have to take the manufacturer at their word on that one.