# Frequency and time confusion

Discussion in 'General Electronics Discussion' started by electronicsLearner77, Sep 18, 2017.

1. ### electronicsLearner77

162
1
Jul 2, 2015
Whenever i am dealing with frequency of signals in micro controllers. I am always getting confused with calculations. Should i proceed thinking of the signals completely in terms of frequency or completely in terms of time duration. I get terribly confused. How should i handle? Any suggestions? Sorry for not relavant question.

2. ### AnalogKid

2,497
718
Jun 10, 2015
The time of a periodic signal is called its period. That is the elapsed time of one complete cycle of the signal. It is the inverse of the frequency. a 10 Hz signal has a period of 0.1 (1/10) second. All repeating signals have a frequency, and hence a period. You use whichever one is appropriate to what you are doing. It rarely is appropriate to think of a signal "completely in terms of frequency or completely in terms of time duration."

For example, a task might be to use a uC to measure the frequency of a signal. A uC cannot measure frequency, but it can measure time either by internally counting in a software loop the number of passes through a loop, using an internal counter peripheral to count cycles of the uC clock, etc. You then use software to invert the result, place the decimal point correctly, and format the result for whatever the display is. So you think in terms of period for the measurement, and in terms of frequency for the result. tow sides of the same thing.

ak

3. ### BobK

7,682
1,688
Jan 5, 2010
Actually, AK's example is the perfect example of why you must think both in terms of time and frequency. Suppose you need to measure a frequency.

Let's say it is in the region of 1 MHz. Your micro will not be fast enough to measure the time between consecutive cycles. The way you do this is to send the 1 MHz signal directly to a counter on the micro. You then run a timer to set and interval of, say 10 ms. At the end of the interval, you take the count from time timer and calculate the frequency, for example. 10000 counts is exactly 1MHz. This is measuring frequency.

Now suppose the signal is 1 Hz. In order to measure this the way same way as you did 1 MHz, you would have to make the interval 100 seconds to get 1% accuracy. This is most likely way too long to wait. Instead, you measure the time by starting a timer at the leading edge, and stopping it at the next leading edge. Now the counts in the timer gives you the period, and you invert it to get the frequency.

Bob

Last edited: Sep 18, 2017
electronicsLearner77 and OBW0549 like this.
4. ### OBW0549

159
118
Jul 5, 2016
Neither. You simply will have to become adept at both. There is no way around it.

Practice, practice, and more practice.

5. ### dorke

2,342
665
Jun 20, 2015

All Signals may be represented in the time domain or frequency domain.
They are like two sides of the same coin.
The ability to "view" them in each domain is "handy",
you should pick the one that is the simplest to handle/most useful/best to gain insight etc.

Note that most signals are not periodic as described above,and still both time and frequency apply to them.
It is sometimes referred to as time-frequency analysis/spectral content vs. time.
In general, the Fourier content of a time signal and vice versa .

Here is a complex periodic signal in time and frequency:

Note :
although the signal is periodic,and you could talk about it's frequency to be f0=1/T,
infect, this is only part of the all picture:it relates only to the fundamental frequency of which this signal is "composed".
In the frequency domain we simply have 3 sines combined.

Here is a non-periodic signal and it's "frequency content".

Note:
How simple this pulse(time duration of tau) looks in the time domain and how complex it's content is in the frequency domain.

6. ### Terry01

206
48
Jul 5, 2017
Thank god it'll be a long long time before I need to worry about learning this kind of stuff.....if ever! How you manage to know this of the top of your heads is beyond me. That's maybe a good indicator I should just keep reading and being in awe of these posts???

Hmmmm.....

7. ### hevans1944Hop - AC8NS

4,606
2,151
Jun 21, 2012
Interesting thread. I remember that "ah ha!" moment near the middle of the previous century when I realized that looking at things in the "time domain" versus looking at the same things in the "frequency domain" was still (always) looking at the same things... just a different perspective is all.

8. ### Harald KappModeratorModerator

11,444
2,629
Nov 17, 2011
Plus this different perspective may help solve problems which seem intractable in one domain quite easily in another domain.
@dorke in post #5 gave an excellent example.

Here's one the other way round:
It is almost impossible to separate an audio signal (20 Hz ... 20 kHz) into frequency ranges (low, mid, high) by looking at the time domain signal.
Looking at the same signal in the frequency domain this separation becomes a piece of cake.

hevans1944 likes this.