Hello everyone!
I am new to the world of Matlab and that of Ultrasounds, so please bear with me if my question does not make any sense.
I am trying to simulate the response of an RLC circuit (electrical equivalent of my piezoelectric device) to a burst signal. To generate this signal I am using the k-wave function ToneBurst. To find the voltage on the resistor I am using lsim which exploits state equations. lsim works fine with step, pulse and sine input, but not with ToneBurst (error: "When simulating the response to a specific input signal, the input data U must be a matrix with as many rows as samples in the time vector T, and as many columns as input channels.").
So I tried doing this:
u = toneBurst(sample_freq, signal_freq,num_cycles);
signal = transpose(u);
rowPad=size(t,1)-size(signal,1);
colPad=0;
signal=padarray(signal,[rowPad,colPad]);
signal(1:rowPad,:)=[];
signal(:,1:colPad)=[];
and now it *seems* to be working.
My problem is that I do not know if transposing and zero padding is ok, because it is just a "data format" compatibility problem or if this changes the signal and my simulation is incorrect.
I am very new to ultrasound so unfortunately I do not now precisely which waveform I should expect.
Thank you!