# quantizer and plots in system modeler

**URL:** <https://community.wolfram.com/t/quantizer-and-plots-in-system-modeler/2987>\
**Category:** Questions\
**Tags:** signal-processing, graphics-and-visualization, modeling, system-modeler\
**Created:** [August 16, 2014, 4:46pm UTC](https://community.wolfram.com/t/quantizer-and-plots-in-system-modeler/2987 "2014-08-16T16:46:55Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![manugaurav](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/manugaurav/32/12626_2.png) [@manugaurav](https://community.wolfram.com/u/manugaurav)\
**Post date:** [August 16, 2014, 4:46pm UTC](https://community.wolfram.com/t/quantizer-and-plots-in-system-modeler/2987/1 "2014-08-16T16:46:55Z")

</div>

1. How to simulate or draw quantizer block like 14 bit quantizer in system modeler?

2. After FFT analysis how to plot in dB?

---

<div class="post-metadata">

**Author:** ![henrikt](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/henrikt/32/24544_2.png) [@henrikt](https://community.wolfram.com/u/henrikt)\
**Post date:** [October 9, 2014, 6:02am UTC](https://community.wolfram.com/t/quantizer-and-plots-in-system-modeler/2987/2 "2014-10-09T06:02:32Z")

</div>

I can’t really answer about quantizers, as that is not my field of expertise, but thanks for suggesting dB magnitudes in the FFT analysis!

Note, however, that the FFT analysis applies to a signal and not to a transfer function (system). As far as I know, it is not common to use dB magnitudes for signals, so it seems like there would be some risk of confusion if the magnitude axis were measured in dB; someone reading the plot may think that it is an estimate of the Bode plot of a system rather than the FFT of a signal.

---

<div class="post-metadata">

**Author:** ![manugaurav](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/manugaurav/32/12626_2.png) [@manugaurav](https://community.wolfram.com/u/manugaurav)\
**Post date:** [October 9, 2014, 12:37pm UTC](https://community.wolfram.com/t/quantizer-and-plots-in-system-modeler/2987/3 "2014-10-09T12:37:14Z")

</div>

hi henrik,

normally like antenna plots, the fft which represents frequency plots are plotted generally in dB. for example spectrum analyzer. you can just give it as an option.

if you can suggest anyway to do it here will meet my requirements

---

<div class="post-metadata">

**Author:** ![henrikt](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/henrikt/32/24544_2.png) [@henrikt](https://community.wolfram.com/u/henrikt)\
**Post date:** [October 9, 2014, 12:48pm UTC](https://community.wolfram.com/t/quantizer-and-plots-in-system-modeler/2987/4 "2014-10-09T12:48:18Z")

</div>

I’m not very familiar with antennas either, but they appear to me as systems rather than signals. I could understand how you could feed a spectrum analyzer with an input/output pair to estimate damping and phase shift as a function of frequency, and then plotting in dB makes sense to me. What I still don’t see is how dB makes sense when applied to one signal at a time, as in the SystemModeler FFT analysis.

It would be very useful to us to see examples where dB is used on the FFT magnitude of a single signal. Do you have any references where such use is explained?

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![manugaurav](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/manugaurav/32/12626_2.png) [@manugaurav](https://community.wolfram.com/u/manugaurav)\
**Post date:** [October 9, 2014, 4:33pm UTC](https://community.wolfram.com/t/quantizer-and-plots-in-system-modeler/2987/5 "2014-10-09T16:33:24Z")

</div>

Like DDS as shown in figure below  
i am trying to simulate such system, but how to plot the outputs as shown. these are dynamic models. the idea is not to argue with you but to try to make you understand why a FFT should be plotted in dB to see harmonics and spurious clearly. hope you will not feel bad. i am just trying since you are interested. sorry again

 ![example.png](https://global.discourse-cdn.com/wolfram/original/3X/9/0/909b4d78f599f2918ee91ef326568bc8031cd0a2.png)

i have this thing designed in system modeler which i will not like to share publicly. if you will give me your mail id i can send it for your reference.

---

<div class="post-metadata">

**Author:** ![henrikt](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/henrikt/32/24544_2.png) [@henrikt](https://community.wolfram.com/u/henrikt)\
**Post date:** [October 10, 2014, 6:26am UTC](https://community.wolfram.com/t/quantizer-and-plots-in-system-modeler/2987/6 "2014-10-10T06:26:57Z")

</div>

Thanks, and no need to be sorry. Neither is my idea to argue with you. This is a fruitful discussion which I believe will be of interest to other users as well.

I think that the key here is the word _normalized_ on the magnitude axis. Looking at the plots, it seems like _normalized magnitude_ applies the scaling necessary to make the maximum magnitude 1. With such normalization, dB makes perfect sense! Also, with _normalized magnitude_ in the axis label, the risk of confusion is more or less eliminated.

At the moment, this type of FFT plot cannot be made with SystemModeler, but if you have access to Mathematica, you can always run your simulations with `WSMSimulate` and then use `Fourier`, `Normalize` (with the infinity norm expressed using `Norm`) and the rich plotting capabilities of Mathematica to obtain a normalized FFT plot.

Thanks again for clarifying your suggestion. Your feedback is valuable.

---

<div class="post-metadata">

**Author:** ![manugaurav](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/manugaurav/32/12626_2.png) [@manugaurav](https://community.wolfram.com/u/manugaurav)\
**Post date:** [October 10, 2014, 12:44pm UTC](https://community.wolfram.com/t/quantizer-and-plots-in-system-modeler/2987/7 "2014-10-10T12:44:54Z")

</div>

you missed the point. idea was not normalization. it is just a multiplication.

the harmonics and spurious came pronouncingly only in dB plot but not otherwise. however, i think when you develop next version you can debate of incorporating as part of y axis scaling in plot.

---

<div class="post-metadata">

**Author:** ![henrikt](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/henrikt/32/24544_2.png) [@henrikt](https://community.wolfram.com/u/henrikt)\
**Post date:** [October 13, 2014, 5:22am UTC](https://community.wolfram.com/t/quantizer-and-plots-in-system-modeler/2987/8 "2014-10-13T05:22:17Z")

</div>

I just wanted to express the _Normalized_ part of the magnitude axis label using the `Normalized` function. True,`Normalized` will just find a factor that is applied to all numbers, and one just has to pick the right norm. Here is an example of how to scale a list of non-negative random numbers such that the maximum is 1 after normalization:

```
In[1]:= mag = RandomReal[{0, 100}, {10}];

In[2]:= Max[mag]
Out[2]= 99.6271

In[3]:= magNormalized = Normalize[mag, Norm[#, \[Infinity]] &];

In[4]:= Max[magNormalized]
Out[4]= 1.

```

The reason for using `Normalized` is to make the intention clear, but there are also situations where it is convenient to use `Normalized` since the data (in this case `mag`) does not have to be repeated. In the end, the result is the same as:

```
magNormalized = (1 / Norm[mag, \[Infinity]]) mag;

```

---

<div class="post-metadata">

**Author:** ![habudg](https://avatars.discourse-cdn.com/v4/letter/h/ee7513/32.png) [@habudg](https://community.wolfram.com/u/habudg)\
**Post date:** [October 13, 2014, 5:42pm UTC](https://community.wolfram.com/t/quantizer-and-plots-in-system-modeler/2987/9 "2014-10-13T17:42:09Z")

</div>

I have to agree with manu on this issue. I disagree with this statement:

> Note, however, that the FFT analysis applies to a signal and not to a transfer function (system). As far as I know, it is not common to use dB magnitudes for signals, so it seems like there would be some risk of confusion if the magnitude axis were measured in dB; someone reading the plot may think that it is an estimate of the Bode plot of a system rather than the FFT of a signal.

In my experience, it is very common to look at the FFT of a signal using dB magnitude scaling. Many signals are representing a voltage or current. It may or may not be normalized. For voltages, many times the reference signal is simply taken to be 1 volt. Then, the implied scaling is dBW (dB Watts). Whether normalized or not, it is quite easy to look for spectral components that are “in the noise” (ie, less or much less than -3dB down from the peak) or are competing the the peak desired signal (ie, greater than -3dB down from the peak). Someone explicitly deciding to use FFT analysis is not very likely to confuse it with a Bode plot. Maybe others will chime in with their own opinions.

---

<div class="post-metadata">

**Author:** ![henrikt](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/henrikt/32/24544_2.png) [@henrikt](https://community.wolfram.com/u/henrikt)\
**Post date:** [October 14, 2014, 5:36am UTC](https://community.wolfram.com/t/quantizer-and-plots-in-system-modeler/2987/10 "2014-10-14T05:36:29Z")

</div>

Thanks, David. You gave an excellent argument for plotting signals in dB.

Others are still encouraged to chime in!
