LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is there a way to manually draw a unique waveform in a graphics window, or to modify existing block commands to do so?

Fair warning, I am asking this question before commiting to LabVIEW and therefore have no code to enter. I'd like to see if this feature is possible before I buy anything.

 

I am working on a raspberry pi project that will take audio input through a USB ADC, allow the user to build a chain of block diagrams describing digital effects, and apply those effects before outputing through a DAC. LabVIEW appears to be an excellent and relatively easier program to perform most of these tasks.

 

However one key feature I would like to include is to allow the user to draw (this will be a touchscreen interface) a waveform on a graph, and then operating on similar principles to a vocoder, shape the input signal into that designed form. Does LabVIEW have a tool in which a user can draw a signal shape in such a way? Or can an existing block tool be modified through code to do so?

0 Kudos
Message 1 of 7
(5,645 Views)

I have no idea what a "vocoder" is supposed to be.

 

You could do on screen drawing to create a waveform.  Though nothing I can think of is directly built in.   It is possible to capture mouse events so that it draws them on a graph (button up, button down, mouse move).  It is a bit more of a programming project because you'll have to figure out how to capture those events and turn them into waveform data.  And how would you handle editing a line, or deleting segments of what you drew?

Message 2 of 7
(5,604 Views)

I am working on a raspberry pi project that will take audio input through a USB ADC, allow the user to build a chain of block diagrams describing digital effects, and apply those effects before outputing through a DAC. LabVIEW appears to be an excellent and relatively easier program to perform most of these tasks.

 

It is a common mistake to think LabVIEW is a "program". However, LV is a full featured programming language with all what it brings in to the game. You need to learn lots of things before you could try to do what you describe. I advice you to take the online courses before, like Online Training Core 1, 2, 3.

You can certainly do what you describe in LabVIEW, and actually there are many similar examples, did you try to search for such ones?

 

Using LabVIEW FPGA: https://www.youtube.com/watch?v=N-ITAyEZ3PY

https://forums.ni.com/t5/Example-Code/Pitch-Shifting-in-Real-Time/ta-p/3996166

 

About "drawing" a waveform: I imagine you could create a starter waveform, then using mouse clicks with Events (drags, etc.) the user could modify the shape interactively...

 

Message 3 of 7
(5,600 Views)

@Swhoop wrote:

Fair warning, I am asking this question before commiting to LabVIEW and therefore have no code to enter. I'd like to see if this feature is possible before I buy anything.

 

I am working on a raspberry pi project that will take audio input through a USB ADC, allow the user to build a chain of block diagrams describing digital effects, and apply those effects before outputing through a DAC. LabVIEW appears to be an excellent and relatively easier program to perform most of these tasks.

 

However one key feature I would like to include is to allow the user to draw (this will be a touchscreen interface) a waveform on a graph, and then operating on similar principles to a vocoder, shape the input signal into that designed form. Does LabVIEW have a tool in which a user can draw a signal shape in such a way? Or can an existing block tool be modified through code to do so?


Yes,

 

Mouse clicks on a graph can be detected and used to modify a signal displayed on the graph. I developed such a crtter some years ago and it was unique in teh graph was used as a control rather than an indicator.

 

There are not alot of "pre-written" functions to support that type of thing but it can be done.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 4 of 7
(5,575 Views)

A thought I had that might make an easier start to the project.  Supposed you used a drawing tool like MS Paint, and painted a black line on a white background.  Save as .bmp.

 

Open up the bmp using LabVIEW picture functions, convert to a 2D pixmap.  Any pixel that is black is a data point, any that is white is not.  Of course you could have multple black pixels in a column. Or a curve that loops back on itself.  Or no pixels in a column.  But if you scanned the array and just took the lowest "Y" for each "X".  For any missing "X".  interpolate the between known points.  Now you can scale your X relative to time and your Y relative to output level and have a waveform you can output.

Message 5 of 7
(5,570 Views)

@Swhoop wrote:

Fair warning, I am asking this question before commiting to LabVIEW and therefore have no code to enter. I'd like to see if this feature is possible before I buy anything.

 

I am working on a raspberry pi project that will take audio input through a USB ADC, allow the user to build a chain of block diagrams describing digital effects, and apply those effects before outputing through a DAC. LabVIEW appears to be an excellent and relatively easier program to perform most of these tasks.

 

However one key feature I would like to include is to allow the user to draw (this will be a touchscreen interface) a waveform on a graph, and then operating on similar principles to a vocoder, shape the input signal into that designed form. Does LabVIEW have a tool in which a user can draw a signal shape in such a way? Or can an existing block tool be modified through code to do so?


You will find that audio processing as you described is a lot easier said than done in LabVIEW. I have played around and attempted to do some "additive synthesis" and it did not come out so well. On the screen the waveforms looked okay, but the audio it produced was very clicky and poppy. Maybe a dedicated DAC would do better. 

 

As others said drawing a waveform and turning that into an actual audio output will be a lot of work. You might want to start out simple with an ADSR type envelope generator using sliders or knobs and have a chart display a graphical representation of the resulting envelope.

========================
=== Engineer Ambiguously ===
========================
Message 6 of 7
(5,558 Views)

@RavensFan wrote:

I have no idea what a "vocoder" is supposed to be.

 

 


Think of it as an electronic version of that guitar voicebox thing Peter Frampton used on "Do You Feel Like We Do".

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 7 of 7
(5,556 Views)