Jump to content

integrate matlab in labview


Recommended Posts

hi dears

I'm new to labview

how can i integrate this matlab code to labview

I want to create a flute tone using labview ...Please any idea's about sound and music will be great.

with best regards to u all .

s = 44100; % sample rate

T = 1/fs; % sample period

t = [0:T:2.0]; % signal duration (seconds)

fm = 4; % modulation frequency

fc = 440; % carrier frequency

% A en m zijn afvallende e-machten y(t)=exp(-t/iau)

A = 0.9*exp(-0.001/0.1); % unmodulated carrier amplitude

m = 0.7; % modulation index

% modulation signal

xm = m * A * sin(2*pi*fm*t);

% amplutide modulation

xc = (A + xm) .* sin(2*pi*fc*t);

% ring modulation

%xc = xm .* sin(2*pi*fc*t);

subplot(2, 1, 1)

plot(t, xc)

xlabel('Time (seconds)')

ylabel('Amplitude');

axis([0, 0.2, -1.6, 1.6]); % zoom in display

subplot(2, 1, 2)

N = length(t); % N = length of fft

f = [0:N-1] * fs / (N-1); % frequency vector

X = abs(fft(xc)) / N;

plot(f, X);

xlabel('Frequency (Hertz)');

ylabel('Magnitude Gain');

axis([0,1000,0,max(X)]); % zoom in display

grid

sound(xc,fs)

Link to comment
hi dears

I'm new to labview

how can i integrate this matlab code to labview

I want to create a flute tone using labview ...Please any idea's about sound and music will be great.

with best regards to u all .

Go to Find Examples in the Labview Help menu.

Search for Matlab. Open MATLAB Script - Fractal example.

If you have Matlab installed on the system, and are using the Matlab script node within Labview, it will launch an instance of Matlab and execute whatever you put into the script node.

Gary

Link to comment
hi dears

I'm new to labview

how can i integrate this matlab code to labview

I want to create a flute tone using labview ...Please any idea's about sound and music will be great.

with best regards to u all .

Hello Kameran,

I tried to interpred your matlab code and give you a simple sample in labview.

Please let me know if it is what you want .

John

Download File:post-968-1161115795.vi

Link to comment

Hello Kamaran,

You can't change anything if the controls are outside the loop, and the vi is running.

I can't check this vi, i don't have (want) Matlab installed at home.

I think you need to think differently, but i'm not convinced what i am thinking is a correct thought !

Success!

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.