kameran Posted October 16, 2006 Report Share Posted October 16, 2006 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) Quote Link to comment
Gary Rubin Posted October 16, 2006 Report Share Posted October 16, 2006 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 Quote Link to comment
Aurora Posted October 16, 2006 Report Share Posted October 16, 2006 I see you have LV7.1. If you are able to get LV8.0/8.20 Student edition, you may be able to run the Matlab code as is in a MathScript structure. It may require some modification. Quote Link to comment
JohnS Posted October 17, 2006 Report Share Posted October 17, 2006 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 Quote Link to comment
kameran Posted October 17, 2006 Author Report Share Posted October 17, 2006 Hi Dears ..thanks for all your tips I have tried JohnS example , thanks ... f(t)=a*sin(2*pi*f*t) f=130 roughly c8 on he organ keyboard continous time =10000 i don't know what is wrong here , when i want to change the values exp. frequency ...it doesn't change the sound . Reagrds Download File:post-6517-1161117539.vi Quote Link to comment
Ton Plomp Posted October 18, 2006 Report Share Posted October 18, 2006 i don't know what is wrong here , when i want to change the values exp. frequency ...it doesn't change the sound . Reagrds Hi Kameran, use 'execution high lighting' and see what is wrong, then do a search on Data-Flow programming. Ton Quote Link to comment
JohnS Posted October 19, 2006 Report Share Posted October 19, 2006 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! Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.