It doesn't give a result. mablab couldn't take the integral of M = cos(2*pi*a*ti);

1 vue (au cours des 30 derniers jours)
%% Message
syms ti; %time symblol
[a, fs] = audioread('REALLY.mp3'); % read the file
M = cos(2*pi*a*ti); %generic message
Mi = int(M,ti); % integrated message
ti = tp; % to substitute
Mii = eval(Mi); %substitute
M = eval(M);% message but as array to plot
FM = cos(2*pi*fc*tp+B.*Mii); % the Fm transmitted message
FM_noise = awgn(FM,20); %adding additve white gaussin noise
  4 commentaires
gonzalo Mier
gonzalo Mier le 8 Mai 2019
Of course I cannot show them to you, I don't have the value of tp, B or fc. Also, your question is about the integral. The integral is working quite well. If your problem is the other part, you can ask about it directly. Can you please give us a full example of your code and tell us exactly what your problem is?
Alperen Burak Özder
Alperen Burak Özder le 9 Mai 2019
Modifié(e) : Alperen Burak Özder le 9 Mai 2019
My problem is FM modulation and demodulation of an mp3 file.

Connectez-vous pour commenter.

Réponses (1)

John D'Errico
John D'Errico le 8 Mai 2019
"It doesn't give a result. mablab couldn't take the integral of M = cos(2*pi*a*ti);"
Actually, the failure arises because you don't understand how to use MATLAB here. a is a numeric vector. ti is a symbolic variable. But you are trying to live in the realm between numerical integration (thus an integration on data) and symbolic integration. And then you are trying to use a tool like eval in a way that it is not designed to work. Eval is simply not correct there.
You might have done something like this instead:
[a, fs] = audioread('REALLY.mp3'); % read the file
ti = 0:numel(a)-1;
M = cos(2*pi*a.*ti); %generic message
Mi = cumtrapz(M);
Mi is a vector. Do what you want with it.
Skip the stuff with eval. That is meaningless. I'm not even sure what you think it does. (There are almost no cases where you need to use eval.)
  3 commentaires
gonzalo Mier
gonzalo Mier le 9 Mai 2019
Ok, last time I will comment in something from you, Alperen.
1. The code John provides you works if your audio only has one channel. I assume by your error that your audio has more than one channel so instead of numel you can use length(a). If you have just sent one test audio file with your question...
2. Your question and your way of answering people who want to help you are really disrespectful and show that you don't know how this works. People really are spending their time to try to help you. People don't earn money with this, they only try to help. If you don't want to help people to help you, don't try in the first place.
3. I don't know John, but seriously, he knows a lot. You can check his profile and it's awesome. (Also he has the badge of Most Valuable Participant that you can see next to his name).
4. Either way, people who is answering here know really well how to make matlab code. Never ever talk to anyone who is trying to help you like that.
Alperen Burak Özder
Alperen Burak Özder le 9 Mai 2019
Saying people `you don't understand it ' is not a kind way. I just wanted a solution to problem. Not a mentor.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Logical dans Help Center et File Exchange

Produits

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by