SNR from Spectrum Analyzer
MATLAB: I have found negative value of SNR(in dBc) of an ECG signal by using spectrum analyzer block in simulink.Is it correct
ecgsnrspectrum analyzer
Related Solutions
While you cannot concatenate multiple DBC objects or attach multiple to the same CAN Channel, there is a workaround for accomplishing the same end result.
Generally, the reason you would want to do this is because your message definitions are split between two different database files, and therefore you need both DBC files to decode all of your messages.
Attached is an example script which demonstrates how you can go about decoding a timetable of messages whose definitions are in different DBC files. Essentially, you attach one of the databases to the RX CAN channel object, whose messages are decoded upon receipt and returned as a timetable.
% Open two example DBC files (notice they have no conflicting IDs)
db1 = canDatabase("CANBus.dbc");db1.MessageInfo.IDdb2 = canDatabase('CruiseControl.dbc');db2.MessageInfo.ID% Create virtual tx and rx channels
txCh = canFDChannel('MathWorks', 'Virtual 1', 1);rxCh = canFDChannel('MathWorks', 'Virtual 1', 2);% Configure both channels
configBusSpeed(txCh, 500000, 1000000);configBusSpeed(rxCh, 500000, 1000000);% Attach the first database to the receiving channel
rxCh.Database = db1;% Start up both channels
start(txCh);start(rxCh);% Create three messages, two which are defined in db1, and one which is
% defined in db2
msg1 = canMessage(100, false, 8);msg2 = canMessage(200, false, 8);msg3 = canMessage(512, false, 8);% Transmit the messages
transmit(txCh, [msg1 msg2 msg3]);% Receive the messages
disp("After decoding db1 messages:")rxMsg = receive(rxCh, Inf,'OutputFormat','timetable')% Decode the messages which are defined in db2
disp("After decoding both db1 and db2 messages:")rxMsg = canMessageTimetable(rxMsg, db2)% Stop and clear both channels
stop(txCh);stop(rxCh);clear all
You can then call canMessageTimetable on the output timetable, specifying the second DBC file you wish to use for decoding.
Note that if there are any conflicting message IDs between the two DBC files, canMessageTimetable will overwrite any messages which were initially decoded using the first DBC. Consequently, you will want to make sure the two DBC files do not have any overlapping IDs.
Best Answer