Question: Is there any formula to calculate the frequency (or frequencys) of a signal that is bad sampled?

For example, what's the output of an analog signal with F=22Khz when it's sampled at 25Khz, or 10Khz?

EDIT:

In this example, the sampled signal (on the right) have a different frequency than the original one, because it was bad sampled (Fs is minor than 2\*F)

![ ](https://i.stack.imgur.com/OQPEh.gif)

My question is: is there any formula to know what's the frequency of this 20kHz signal, sampled at 30kHz?

Answer: 
Unless the bandwidth of the signal is less than half the sampling rate, you lose information during sampling and generally can't distinguish frequencies after that due to [aliasing](http://en.wikipedia.org/wiki/Nyquist_frequency#The_aliasing_problem).

See [Undersampling](http://en.wikipedia.org/wiki/Undersampling) for more details about sampling at rates lower than twice the maximum signal frequency.

There's no simple formula that can give you the spectral content of a signal or the main frequency. In general you need to calculate a [Discrete Fourier Transform](http://en.wikipedia.org/wiki/Discrete_Fourier_transform) of the sampled signal to find that out. If you're interested in whether or not there's a specific frequency, or how strong it is, you can calculate DFT at that frequency. The [Goertzel algorithm](http://en.wikipedia.org/wiki/Goertzel_algorithm) can be an option.

**EDIT:** a signal at frequency f such that fsample/2 <= f < fsample will alias to f\* = fsample - f, hence a 20KHz sine wave sampled at 30KHz will appear as a 10KHz sine wave.  

In general frequencies above the fsample/2 can be observed in the sampled signal, but their frequency is ambiguous. That is, a frequency component with frequency f cannot be distinguished from other components with frequencies N\*fsample/2 + f and N\*fsample/2 – f for nonzero integers N. This ambiguity is called aliasing[\*](http://en.wikipedia.org/wiki/Sampling_%28signal_processing%29#Theory).
No any formula to know what's the frequency of 20kHz signal, sampled at 30kHz. But it is a fact that the frequency of undersampled signal will be reflected about Nyquist frequency. In your example 30 kHz means that Nyquist frequency is about 15 KHz, that is not enough to record original signal (20KHz) correctly, only 15 kHz of it distributed, another 5 KHz (reminder after distribution of 15 KHZ) during reflection about Nyquist frequency appear in position 15-5=10 KHz. This is final ansver. The frequency of sampled signal will be equal 10 kHz in your case