01-16-2022 06:08 AM
Hey fellas!
I'm currently trying to explore the sinc function and am facing some difficulty. I wish to view it with in 0 to 1 in the time axis and with a main lobe amplitude of 200. I want to it reach this peak at 0.5. No matter what I do, I'm unable to limit it to that range.
I have attached my trial as well.
Please help me out.
Cheers!
01-16-2022 09:05 AM
Thank you for attaching your VI. Here are some suggestions for modifying it and using it as an "Exploratory Tool" to better visualize the sinc() function.
First, I hope you read the Detailed LabVIEW Help for this function. If so, you'll see that it reaches its maximum value at whatever you set Amplitude to be, and it will do this at T = 0 (ignoring, for the moment, Delay). This means that if you are plotting it, and you don't plan to change the Amplitude, Delay, or Samples variables (and you set Delta t to 1), then your Graph will have Time going from 0 to 128, and will have values that lie in the range [-1, 1].
A suggestion to learn (a lot) more about this function and how LabVIEW uses graphs -- put Numeric Controls in for Delay (dbl), Delta-t (dbl), Amplitude (dbl), and Samples (I32), with default values of 0, 1, 1, and 128. Do you know how to set Front Panel values as "Default"? Put them on your Front Panel, put the Values you want to be the Default in them, then click the "Edit" button and choose "Make Current Values Default".
So wire these up to your "sinc" function. Something else to realize -- you don't want to plot, then replot, then replot ... as fast as the computer can run -- it is a waste of electrons! Put a "Wait (ms)" with a value of 100 inside there -- this slows the loop down so it only runs 10 times a second, so when you change one of your Front Panel controls, you have to wait a whole tenth-of-a-second to see the change. I'll bet you can't detect the delay ...
If you change some of these properties, you'll (potentially) mess up your Graph. For example, if you start the program and change Samples to 64, you'll "miss" the tail of the plot, while if you make it 1000, you won't see anything past 128. Can you fix this? Yes, but it involves asking LabVIEW to change the properties of the Graph "on the fly". This isn't difficult, but is a later lesson ...
Bob Schor
01-16-2022 01:34 PM
Also:
01-16-2022 11:07 PM
Hey @altenbach!
PFA my latest attempt at it. I've made changes that help me get the 200 amplitude but I still don't get how to view the sinc function within [0,1] reaching the peak at 0.5.
What I basically want is this:
Please bear with the poor quality.
01-17-2022 01:04 AM
@niharika28 wrote:
Please bear with the poor quality.
That looks quite grizzly. 😄
What's the purpose of the lower graph?
01-17-2022 11:50 AM
It is bad enough to post "pictures" (instead of providing LabVIEW code) in the Forum, but there's really no excuse for blurry pictures where the "important details" cannot be seen. [If you'd provided code, we could run it and see what you are seeing, and also (probably) tell you how to "fix it".
If you had followed my advice to build a simple VI that lets you "explore" the Sinc Pattern VI by playing around with the four parameters of this function, I'm hopeful you would be able to (a) create a Sinc function whose peak amplitude was 200, and reached its peak at 0.5 (in some as-yet-unspecified units).
Note that you should also be able to figure it out with pencil and paper by writing down the definition of the Sinc function and using high-school algebra to figure out how to modify this formula to (a) make it reach any peak amplitude you wish, and (b) have it reach this peak at any value of the dependent variable (usually called "x") you wish. Plug these numbers into the LabVIEW definition of the Sinc Pattern and you should have what you want.
Bob Schor
01-17-2022 12:31 PM - edited 01-17-2022 12:35 PM
The sinc function is centered at zero, meaning your x-axis fails to correctly define x0, while dx seems to be defined, but also incorrect. To get your twisted x-axis, just do the calculation for x= -0.5..0.5 (after your custom scaling), then set x0 to zero.
Maybe you want to start with the plain sinc function instead of sinc pattern.
It seems more and more like homework, especially since you seem to intentionally blur the image from the homework assignment, potentially to prevent us from doing a reverse image search on it. No tricks please!