Also, had another thought: What might help a lot, is developing the skill to differentiate accurately between your own thoughts and feelings and the feelings/thoughts that others send/project on you.
At some point I discovered a pattern in when I would suddenly feel aroused out of nothing, mostly in the morning hours in bed. I somehow was able to get a quite accurate log on when my ex-girlfriend would wake up in the morning (through her facebook or whatever, don’t remember exact details), and I discovered an exact match with those times and the timing of those feelings. So, in the morning she was sending sexual energy to me, and visualised having sex with me. We had broken up a few months before, so the cord/connection was still quite strong.
I also noticed that the feeling came totally unexpected, without me thinking anything sexual or anything related to her. A few years later, I had a very interesting experience with another ex-girlfriend with whom I had broken up a few months before, so still quite fresh. I was sitting on the bench, watching TV, and all of a sudden I felt strong sexual arousement, and I knew it came from without myself. 2 minutes later the ex calls me, and after some chit-chat offers to pass by my house. I politely told her, “better not”, and then had the guts to ask her if was thinking of me in a sexual way the few minutes before she called. And she hesitantly admitted it. For those wondering, I said “no” to her offer because she had broken up with me, exactly when we became more emotionally connected, more intimate, so I knew this would be just a sex night and nothing more, which to me doesn’t feel good, and I prefer to take the time to emotionally process the breaking up of relation, and in that period have virtually no contact with the ex. Taking time to break the cords/connections. Having after-break-up sex doesn’t help at all .
So, since then, I know very accurately when a feeling or thought comes from within or from without.
So, perhaps you can meditate a bit, or analyse the moments when you suddenly think of or have feelings w.r.t. your ex/friend? And try to find out if it comes from within or without. Has proven helpful many, many times.
That could help a lot in finding out what’s going on. Good luck!