DSPRelated.com
Forums

Spectrum plots in MATLAB/Spectrum

Started by Ted September 8, 2004
Martin Blume wrote:

> "Jerry Avins" schrieb > >>Dave Kirkland wrote: >> >> >>>Jerry, there 2 reasons why they may not be the same level. >>> >>>1) Ted wrote that the components were sin(2piFt) and sin >>>(4piFt), here really didn't say their magnitudes were >>>equal. >> >>Then if one component were sin(2piFt) the other would need to >>be Asin(4piFt), with A not equal to 1. Or am I too literal >>minded? >> >> >>>2) Even if their magnitudes were equal, if the the tonals >>>do not lie directly on an FFT bin, then spectral leakage >>>occurs resulting in different magnitudes. The amount of >>>leakage depends on the type of window used, and on the >>>relative frequency locations with respect to >>>the FFT frequency bins. >> >>Of course, but Ted wrote that he expected to see a 6 dB >>difference, I asked why, but got no answer. > > > And perhaps a third reason: > > 3) Depending on where he measures the signal, the transfer > function at this point might have changed the relative > amplitudes of the two frequencies. > Transient effects (filter settling time) or effects of the > mathematical simulation might account for the difference > being "only" 4 dB instead of 6 dB. > > I didn't read in the original post any rigorous statement > as to: > - what the input signal is ["consisting of a couple of sine > waves ie sin(w1t) and sin(w2t)" -> the assumption here is > x = sin(w1t)+sin(w2t)] > - where the signal is measured > x (input) ----> H1(z) ----> H2(z) ----> y (output) > +-->here? +-->here? +-->here? > I assume the output (y) ["At one point in the system I > tap of a signal"]. > > Regards > Martin
All of that is reasonable, even likely. Still, when someone has a problem and asks for enlightenment, I assume that he gave enough detail to make enlightenment possible. A 6 dB variation in an octave requires a fancier filter than is likely to be an artifact of cabling. We've spent a lot of time and bandwidth on Ted's thread with no indication that he's still participating in it. Until he tunes in again of I'm addressed by name, I'm out of it too. Jerry -- Engineering is the art of making what you want from things you can get. �����������������������������������������������������������������������
Rune Allnor wrote:

> Jerry Avins <jya@ieee.org> wrote in message news:<41407ee3$0$6917$61fed72c@news.rcn.com>... > >>Bernhard Holzmayer wrote: >> >>>Rune Allnor wrote: >>> >>> >>> >>>>ed_ted_ed@yahoo.com (Ted) wrote in message >>>>news:<39c154be.0409081457.309b561a@posting.google.com>... >>>> >>>> >>>>>Been modelling a system using simulink. At one point in the >>>>>system I tap of a signal (consisting of a couple of sine waves ie >>>>>sin(w1t) and sin(w2t)), do a 2048 point FFT and have the results >>>>>displayed using the graphing capability in simulink. The >>>>>simulation time is about 10 seconds. >>>>> >>>>>On the spectrum plot I expect to see a difference of 6dB level >>>>>between sin(w1t) and sin(w2t).What I actually get is this - when >>>>>simulation is active, ie the 10 seconds is not up yet, I notice a >>>>>4dB difference. As soon as the simulation ends, right after 10 >>>>>seconds, boom, the spectrum shows the correct dB level difference >>>>>between the two sine waves ie 6dB, >>>>> >>>>>Question - anyone else see this difference in the behaviour of >>>>>simulink when doing spectrum displays, ie one for the case when >>>>>the simulation is running and the other when simulink has just >>>>>stopped simulating ? >>>>> >>>>>Should results be examined only after a simulation session is >>>>>completed ? >>> >>>I don't think so. But be aware that during simulation, not all >>>blocks of your simulation are updated in real time. >>>Check the simulation properties page, especially. >>> >>> >>> >>>>What the DSP is concerned, it would be nice to have some more >>>>information about the signal, like sampling frequency, signal >>>>amplitudes, the actual values of your frequencies, etc. >>>> >>>>What simulink is concerned, you might want to cross-post to >>>>comp.soft-sys.matlab, where you are likely to find the simulink >>>>wizards. >>>> >>>>Rune >>> >>> >>>To my experience, you find real Matlab wizards, and lots of. >>>But there are obviously not so many simulink users and even less >>>wizards there - don't know why. >>> >>>Just one hint: usually, there are storage limitations activated, >>>when you run your simulation. After it has terminated, intermediate >>>results are thrown away and you see only lets say the last 5000 >>>points. During simulation, you get an intermediate result >>>displayed, as soon as enough information is available. >>>Then, calculation seems to have precedence and display is hardly >>>refreshed, until all calculation has finished. >>>In your case there might be an initial error which is displayed in >>>the beginning and which h asfadedawayoncesimulationisdone. >>> >>>If your setup allows it, set your simulation (end) time to 'inf', >>>and watch the results. If my expectation is correct, you'd see the >>>4dB difference in the beginning - then after some time it should >>>change to the 'correct' values. If not, there's another effect. >>> >>>Bernhard >> >>Am I the only one who believes that the spectrum of [sin(wt) + sin(2wt)] >>should consist of two lines of equal length? >> >>Jerry > > > Nope. But there is insufficient information in the original post to > make up any opinion as of what one should see in this particular case. > The frequencies are given as w1t and w2t which I (perhaps unjustified) > interpret as w_1*t and w_2*t, with w_1 and w_2 arbitrary. Second, there > is no amplitude information. No explanation is given to why the OP expects > to see a 6 dB difference in level. Last, there is the question of exactly > how simulink does its voodoo during the simulation. > > Rune
I interpreted the frequencies as 1*w and 2*w and never looked back. Silly me! Thanks for the enlightenment. Jerry -- Engineering is the art of making what you want from things you can get. &#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;