Search Unity

What is the best way to create a Spectrum Analyzer line?

Discussion in 'Editor & General Support' started by ShinNoir, Jul 25, 2021.

  1. ShinNoir

    ShinNoir

    Joined:
    Jul 25, 2021
    Posts:
    3
    For reference here is a Spectrum Analyzer and what the line looks like.


    I have an idea for a game where you and a friend try and jam each other's satellite signal.

    My first major hurdle is how to best draw a line with a 1000+ points on it where each point is animated and can be influenced on a particular frequency by how much power you put into it.

    Second hurdle is how to confine what is drawn/animated within the bounding box of the screen? Because looking at the entire frequency spectrum will not give you any useful data to attack or defend from.

    Any suggestions would be helpful because Im a noob at unity and dont know what all is possible other than using line render but after some reading that may not be the best option.

    So what is the best way and how would you do it?
     
  2. KomeijiSatorin

    KomeijiSatorin

    Joined:
    Jun 13, 2021
    Posts:
    31
    Hmmmm.... By reading your description I actually have no idea what the game should be like... I mean, yeah I get the idea that there is some simulation of signals there, but how does that translate into satellite control? You know you probably don't need very precise simulation, what you probably want to do is to simplify it in a way that is more understandable by those who are not familiar with signal processing, and it also gives you a happier time programming it. For example if your satellite reads signal intensity in dB from different frequencies, you will just need a FFT graph and several important frequencies. You can easily simulate those graphs by using several triangles and FFT graphs should be easy enough for non-engineers to understand. Defense could be done by applying filters but those filters must be configured by following several rules and sometimes you need to combine different filters to achieve what you want.
     
  3. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,859
    Drawing lines in Unity isn't super easy out of the box. I'd probably use a plugin like Vectrosity to do this.
     
  4. ShinNoir

    ShinNoir

    Joined:
    Jul 25, 2021
    Posts:
    3
    Awesome, thank you for the suggestion.
     
  5. ShinNoir

    ShinNoir

    Joined:
    Jul 25, 2021
    Posts:
    3
    You will want to look up a concept called Uplink Jamming. What you are trying to do is to find the right frequency that your opponent is on and then on that same frequency put up some noise with slightly more power to drown out their signal.

    Kinda like the old school board game battleship, but once your ships start getting hit you can move them.

    But yes there were be a certain amount of learning curve to understand what is going on, so I plan to have a good tutorial to explain it all.