# Java1478-fun with java, how and why spectral analysis works  (Page 7/9)

 Page 7 / 9

Although these identities apply to the products of sine and cosine values for single angles a and b , it is a simple matter to extend them to represent the products of time series consisting of sine andcosine functions. Such an extension is shown in Figure 8 .

## Products of sine and cosine functions

In each of the three cases shown in Figure 8 , the function f(n) is a time series produced by multiplying two other time series, which are either sinefunctions or cosine functions.

Figure 8. Products of sine and cosine functions.
```1. f(n) = sin(a*n)*sin(b*n) = (1/2)*(cos((a-b)*n)-cos((a+b)*n))2. f(n) = cos(a*n)*cos(b*n) = (1/2)*(cos((a-b)*n)+cos((a+b)*n))3. f(n) = sin(a*n)*cos(b*n) = (1/2)*(sin((a+b)*n)+sin((a-b)*n))```

## Rewrite and simplify

Figure 9 rewrites and simplifies these three functions for the special case where a=b , taking into account the fact that cos(0) =1 and sin(0) = 0.

Figure 9. Rewrite and simplify.
```1. f(n) = sin(a*n)*sin(a*n) = (1/2)-cos(2*a*n)/2 2. f(n) = cos(a*n)*cos(a*n) = (1/2)+cos(2*a*n)/23. f(n) = sin(a*n)*cos(a*n) = sin(2*a*n)/2```

## What can we learn from these identities?

First you need to recall that the average of the values describing any true sinusoid is zero when the average is computed over an even number of cycles ofthe sinusoid.

(A true sinusoid does not have a bias to prevent it from being centered on the horizontal axis.)

If a time series consists of the sum of two true sinusoids, then the average of the values describing that time series will be zero if the average iscomputed over an even number of cycles of both sinusoids, and very close to zero if the average is computed over a period that is not an even number of cyclesfor either or both sinusoids.

(The average will approach zero as the length of data over which the average is computed increases.)

## Product of two sine functions having the same frequency

Let's apply this knowledge to the three cases shown above for a=b . Consider the time series for case 1 in Figure 9 . This case is the product of two sine functions having the same frequency. The result of multiplying the two sinefunctions is shown graphically in Figure 10 .

Figure 10. Plot of sin(x) and sin(x)*sin(x).

The red curve in Figure 10 shows the function sin(x), and the black curve shows the function produced by multiplying sin(x) by sin(x).

## The sum of the product function is not zero

If you sum the values of the black curve over an even number of cycles, the sum will not be zero. Rather, it will be a positive, non-zero value.

Now refer back to Imag(F) in Figure 6 . The imaginary part is computed by multiplying the time series by a sine function and computing the sum of theproducts. If that time series contains a sine component with the same frequency as the sine function, that component will contribute a non-zero value to the sumof products. Thus, the imaginary part of the transform at that frequency will not be zero.

## Product of two cosine functions having the same frequency

Now consider the time series for case 2 in Figure 9 . This case is the product of two cosine functions having the same frequency. The result of multiplying twocosine functions having the same frequency is shown graphically in Figure 11 .

#### Questions & Answers

we need to know the human mind and behavior and how it works. this can make us successful in our jobs because we know what to do to please the people or to catch them lying etc.
is a Greek word for soul
carolline
scientific study of the human behavior
carolline
Humans are extremely inconsistent at catching out liars. Human intuition and lie detection methods are prone to all kinds of biases. Always follow the evidence and don't let your emotions influence your rationality.
Leon
hello everyone, i was just wondering i have to pick a theoretical perspective to describe a mental disorder, i have picked Anti social personality disorder and was going to use the biomedical model to explain it. does anyone here regard aspd as a neurobiological disorder? kind regards.
is anti social personality disorder a neurobiological illness?
niamh
rationalisation, displacement and reaction formation
only a perspective of what we have pursued till now as an experience
Priyank
what is the meaning of pysche?
The meaning of psyche is Mind
Jobin
Friends can anyone please tell me, why the study of psyche is so important?
Jobin
Well in Greek, it means "soul, spirit, the mind, or the invisible animating entity which occupies the physical body".
Friends can anyone please tell me, why the study of psyche is so important?
Jobin
Friends please tell me how to counsel a student who does not want to change their lives but are comfortable in the same life situation?
Jobin
I think it's such an important study because it's one if those rare things that can't be understood in the conventional manner. The mind (not the brain, but the soul and spirit), cannot be studied physically, or through the use of sight, touch, smell, taste, or hearing.
Much focus and attention would have to be put into it to understand it, and it can't be fully understood because everyone's different and subjected to different circumstances, and we live an ever-changing world. It's important because it helps to develop spiritual, mental, and emotional intelligence
is humanities a good stream? is there scope for a subject like psychology in the future. is it a good choice?
is humanities a good subject?
amrita
Sure it is.
Jobin
you gonna opt for humanities as long as you don't want to pursue psychology in BSc honours , you'll be able to pursue BA psychology only. So if you want to pursue BSc then go for Science stream only.
Priyank
Morning everyone. How can you help a person who can't stop musterbating?
find a different activity to divert the need to masturbate
vincent
masturbation is a need u cant stop it
Abhilash
Try positive punishment then transition to negative punishment
Atone
It probably has something to do with the environment one grew up in and their genetics that caused their puberty to have this psychological effect on them.
Atone
trying to keep yourself busy with stuffs you love doing the most.like reading or listening to music or sports
Naomi
addiction and attachment issues do go hand in hand
vincent
stop watching pornography if you do; it leads you to fantasizing via masturbation. If you are a Christian, try indulging is spirituality (music and prayrer) before your bed time.
Matovu
don't stop watching anything but instead pay attention to yourself and be conscious enough of what happens inside your brain or how the thought process goes that leads you to masturbating
Priyank
Hello everyone have a nice day
Mary
Hello
Georgescu
internal for example a times when when I watched a pornography movie I end up thinking about it a lot so what I used to stop it is to create something in my mind that can ever exist in real life. I can create a story for about a week in my mind just to forget about it and it actually helps me
Mary
@mary charm story construction is helpful but then it open up on doorways for a new problem or addiction per say since it gives boost to the overexaggeration of reality which is not right, instead try to jot down what do you feel, be it digitised or normal writing. painting it also helps.
Priyank
she**
vincent
Marriage is the only solution guys.You can't do it if you get 'it'
Philip
I agree philip Nyenze. in addition to self control
Diamly
Hello y'all! I'd like to start by saying, Marriage isn't a solution for everyone. We all have differences across the board, mental, spiritual and physical. Personally marriage has fixed it for me but not for the reason you'd think. In fact the complete opposite. I found myself with a partner who's..
Samwell
... spiritual views and mental issues (depression) caused my partner to be very distant physically and it caused so much heartbreak and pain within myself and in turn made my mental health to whirlwind out of control. it took 4 years to get through it but I concentrated on my love for my partner...
Samwell
.... outside of the bedroom because I wanted them completely. through trials and error I think I finally got myself in a good place. I don't need to masturbate because even though the hormones are rushing within me and I want to tackle my partner down, my soulmate shines through brighter than that..
Samwell
... gorgeous body.
Samwell
You have to stop thinking about the filling that u can get from musturbation and get a partner if only you are 18 years and above.
Tanam
Unless it's a chronic problem like they are addicted to it and do it all the time, then let them be. Masterbation is a natural thing there's nothing wrong with it and it has many health benefits. As long as it isn't a chronic case they're be fine.
UnhealthyCopingMecha
how natural is it?...this i just a formed habit. it takes 3weeks(21)days to form an habit...if youve done it more than 21days,admit its your habit...same it can take 21days to end a formed habit.if you've wanted to stop this habit,contact me personally i'll guide you through
Philip
hi how to join conversation?
i don't know
Azeneth
How can you say that your bestfriend is true to you?
why is my mom so mean?
Hello Krista! Idk what made you think that ur mom is mean, but trust me, that's just not true. She really loves u and cares for u, but it's just that her way of caring is different than others. Ik it sounds mean, but deep inside her heart, she loves u a lot, just like all moms love their children.
Drazy
perhaps, but if you could elaborate on what exactly she does that is demeaning, because sometimes some lessons that are best learned are through a tough and disciplined manner, most likely she really loves you and wants you to learn the lesson once, so you won't have to find it out the hard way
Eldar
I have been assigned to an emotional disturbed student. She seemed fit first but you notice she interrupts or teases other students.would you work with this student an class to improve the situation?
Saleem
Hello ! I think that she's kind of person that shows her bad side before the good. In other words "if you gonna love me ,first you should accept my bad side" These kind of person have the purest love ,once you get through their bad side , it demand some patience and emotional control but , It worth.
aziz
Farhat
We can't know for sure. Whatever decisions your mom makes at the time are her best choices to fulfill her needs, in a way, so her meanness probably in relation to her own prioritization of needs, upbringing, temperament.
frootloop
Also, it's likely part of who you are, as well. By growing up with her, you're likely more vulnerable to her attacks, and they trigger you easily. These are both things that could potentially change, but not without a lot of work
frootloop
Hope this helped! I'm no therapist or psychologist, so take what I say with a grain of salt
frootloop
Rge only one onbthis planet have the ability to be with u whatever happens
Mohammed
What is the relationship between physical development and motor development
what is memory
the faculty by which the mind stores and remembers information. "I've a great memory for faces" something remembered from the past; a recollection.
Amber
what is the difference between Counsellor and Psychologist?
One talks you through your problem helping you solve them on your own (and vent out). The other writes a prescription for you and diagnoses the medical issue lying beneath (eg depression, anxiety)
Vasu
A psychologist has been trained to look at behavioural aspect of mental problems rather than look at biomechanical perspectives. He is more likely to ask his patient about his past and his present behavior, his feelings and his problems to arrive at the root cause.......Read more
Miraj
psychologists have a better understanding and awareness of behavioural reasons of mental problems than others.
Miraj
Instead of the behavioural approach adopted by psychologists, a counsellor tries to encourage the patient to direct the treatment session. He creates an environment where the patient is able to clearly see through his own problems and the reasons underlying these problems........Read more
Miraj
Thus, without relying anybody else, the patient is able to overcome his problems. In a broader sense, both psychologists and counselors both are specialists who try to solve mental problems of people through adopting different approaches.
Miraj
@Kadir shuaib, I hope you understand l
Miraj
Thanks to bits@Miraj Gillani But I've told that Counselling is applied psychology and counseling only effective when theory is applicable.
Miraj
A memory is a faculty which permits human to situate his actions and his state in the times and space.
Sinaly
@vasu a psychologist can't give you a drug as a prescription, that's the job of a psychiatrist
Argoncor
hi I have dealing with a lady who is severely depressed .. she gets suicidal attacks even at the thought of her mother in law . I am working on realeasing her stress .. any other suggestions?
Sriya
hi sriya.. try engazing her in some activity...like cooking,or any u like...make ppl appriciate her effort...plan such that one or other alawys keep appreciating her efforts...that will bring value to her own existence...but it will definetly take some time so u must have patience. tke cre champion.
ARJUN
ARJUN great idea.
Cindy
Hey Sriya! U can take her 2 sum place where she can inhale some fresh air&feel good.&when she gets suicidal attacks 'bout her mom-in-law,u can try calming her down by saying that her mom-in-law wud also appreciate her works&she wud b sad if she knew that her daughter in law is unhappy.Gud luck,girl!
Drazy
Idk about Drazy's comment, something that worked for me was to defy irrational thought patterns and watch out for them to defuse your own suicidal thoughts. Maybe find a focus to life completely independent of the MIL
frootloop
Sriya she needs to do something that makes her happy. I used to spend time with a depressed lady I ask her if anything helped her. when she had anxiety attacks she said music. Whenever I could feel her starting to have an attack I'd hand her head phones along with her favorite music.
Cindy
I asked her she said her husband she has anchored her entire happiness with her husband. she can't even move without him
Sriya
I apologize Sriya I just joined the conversation, I don't know about her husband ; therefore I am not able to give suggestions.
Cindy
@sriya you need to give her an insight about her own individuality so she could seperate herself mentally from her husband and see for herself what she is and where she is! you need to make her understand this that her husband and she herself are two both seperate individuals, may be meditation....
Priyank
...can give her a new tangent to think and pursue reality as it, I use meditation alot on my clients to give them a fresh perception of reality...
Priyank
Hi
ABUBAKAR
Excellent point Priyank
Cindy
thank you everyone I think I know what to do ..
Sriya
Maybe there's a dependency on the husband, and has a bearing on the lady's relationship with her MIL? Like, her MIL is threatening to her
frootloop
Exactly frootloop. Similar to changing a negative thought to a positive thought.
Cindy
What is the deference between Counseling and Psychology?
ABUBAKAR
I think Cindy and Arjun's answers are great. I'm no specialist, but having something private that she's not at war with and can appreciate (activity, hobby, music, etc) could definitely be helpful
frootloop
hey mates..we r part of d universe and essence of universe is continuous activity..even stagnant water fouls..depresn over d top take self value...hence engazin in some purpose oriented work(activity )along with fellows appriciation(value) is two pronged strategy. but it all takes time.u need to b
ARJUN
smart n patience..as depressions dosnt have a face..!!! love u all
ARJUN
always make her to feel important
Mary
@First know the root cause of the issues she's been traumatized with..talk to her in her own language without any Prejudice let her confide in you then you can get the solutions...as the primary reason for depression is being lonely around your own people and house..an open ear to listen to ur silly
harvey
... stories piled up urges, desires a warm hug that human touch we loose over time... saying is easy but living in it is insane..we all need someone to dump our day with..make her realize the consequences if she does hurt herself or others..as u cannot be with them 24/7 so try instilling the...
harvey
...SELF ESTEEM AND BELIEF which she lost over time to her own people..ask her to do some activities which will earn money online and are fun while doing so...keep herself busy not sit and overthink on things!
harvey
Sriya. Give her a story.where you passed the same. If you dont have your own story,then create one. As you give the fake story you tend get more into her shooes.,such that u feel as if u had once being stressed and u overcame it.Make the story bitter that she even symphathizes with u.
Philip
....this way,your patient trusts you more. They believe if they do whatever u tell them they Must overcome their situations....i once told a patient,"if you feel urine and hold on for atleast 2hrs,u will forget all that"...he believed tht so he always drink alot of water to create the urge to urinat
Philip
...he started focusing on how to create urine in his bladder,and he forgot all tht was disturbing.....i nicknamed him "fish."...and am working a theory on the same case. i will post "The Fish theory" once am done with it...though i might change its title,....
Philip
importance of social psychology in the domain of education
Buddhist perspective on motivation..
what is empirical observations
Empirical observation is a type of observation which is based on experiment not on theories. And this observation is not supported by scientific poof.
Miraj
why we do dreams? please tell me
Saleem
the thoughts which we stop thinking suddenly during day. they try to get out of our unconscious mind and they make a story which we term as dreams.
vritee
thank you
Saleem
family members very good morning beautiful lady and family and my family and one that works
holyghostChristine
pls what's sociology of education
solang
The sociology of education is the study of how public institutions and individual experiences affect education and its outcomes. It is mostly concerned with the public schooling systems of modern industrial societies, including the expansion of higher, further, adult, and continuing education.
Amber
Can someone please elaborate more of the unconscious, preconscious and conscious level?
family members very good and the other side working today right after school today
holyghostChristine
@holyghost christine chutiya ho ka be?
Priyank
hahahaha😂😂
Amber
sounds like kanpuriya
Amber
delhi se hoon behnchxxd...
Priyank
have you people downloaded this app to discuss this things
Abhilash
**these
Priyank
**? (missing question mark)
Priyank
@abhilash...
Priyank
mm
Abhilash
priyank.apko aise slang to use ni karna chahiye
tapaswini
hahahaha😄
Miraj
@priyank u understood my point,that is enough bro.
Abhilash
well if it's for you...
Priyank
@tapaswini that person with the name holyghost christine made me do it, i didn't wanted to, I controlled myself alot but then it just broke free since this person is posting gibberish all over the other posts as well, posting stuff that doesn't even has a meaning or relevance to the question asked.
Priyank
hi
pallavi
hello @pallavi priya.
Priyank
hi
pallavi
ok.that's fine.that person is irritating you .that doesn't mean you will say those slangs .if you are studying psychology.you should have the controlling capacity to avoid these silly things .you should not react like that
tapaswini
@ priyank thakur how can I join in the discussion ?
pallavi
guys can u help me wid Buddhist perspective of motivation..
Velda
@tapaswini with all due respect to all the facts that you're putting up, since I'm studying psychology and I guess you're doing the same as well, I guess we can then both accept the fact that being a human means a flood of emotions and swings og feelings most of the times, I am in no way overlooking
Priyank
.....the fact that I should've contended myself but since i also have emotions it's not always easy to contain them, being a lady of your content you must be pretty aware of how things blow up in our own mind sometimes and then how agitation takes over the contentment that we have..
Priyank
@pallavi priya you have already joined in....ask or say that you want to..
Priyank
fine ......
tapaswini
okay
pallavi
is there any other questions
pallavi
Guys since someone talked about outburst of the emotions I also had the same thing with my teacher today in the class
Jobin
I had to get angry
Jobin
guys I'm not a student of psychology but I like to study it
pallavi
guys outburst of emotions is a natural thing.. every individual has their outbursts.. we experience different situations in our daily life out of which some lead to the outbursts... but we should always take care of the fact that someone is getting hurt by our words or not..
manisha
the discussion is going in a different tangent altogether but I like the exposure here.
Priyank
well put @manisha
Priyank
the outburst at many times is not a conscious act. So the question of taking care of the choice of words gets out of the window!
Priyank
@priyank yeah I understand ur point but we should also apologize for for our unconscious behavior when our consciousness returns...
manisha
there's no use of an apology if the person whom you retaliated to, didn't even respond, since it's just a spam account and is here to spread crammy texts.
Priyank
@manisha while it comes to the real world there's no shame in accepting your own committed mistake and apologizing for the same...
Priyank
i just said in general what u should actually do... again after all it's my point of view nd every individual has their own different views..
manisha
Hello guys...
Sandeep
Hello Sandeep
Miraj
@manisha absolutely. but above this all it's been pleasure conversing with you.
Priyank
same here @priyank
manisha
hi Mary the conscious mind includes all the things we are aware of or can easily bring into awareness
Mary
Got questions? Join the online conversation and get instant answers!