LTPDA Toolbox™ | contents | ![]() ![]() |
LTPDA uses an object-oriented approach for data analysis. That means that the user deals with objects. So what are objects? Objects are instances of a particular class. And what's a class? Well, a class just describes an object. For example, you may have a class 'Car' which has certain properties that describe the features of a car. Once you build a Car according to the class description, then you have an instance of a Car - you have an object. We mentioned properties here. Part of the description of a real-world object (or idea) are the features of that object. These features are captured as properties of the class. For example, our 'Car' class may have a property 'color'. Once we build (instantiate) a 'Car' object, then the property 'color' will have a particular value.
Once you have an object, what can you do with it? Well, classes don't only have properties, they also have methods. These are actions you can perform on or with the object. For example, if we return to our Car analogy, the class 'Car' may have a method called 'start' which, when applied to an instance of the 'Car' class (an object), will start the car.
To bring this more in to the field of data analysis, let's look at another example. Suppose we have a class which defines a digital filter. Let's call this class 'miir' - a MATLAB Infinite Impulse Response filter. Such a class would need to have properties which capture features of a digital filter, for example, numerator and denominator coefficients (or 'a' and 'b' coefficients). We might have methods in the class such as 'resp' to calculate the response of the filter.
One special set of methods that a class typically has are the constructor methods. These don't act on objects, but rather act on the class itself. And, as the name suggests, they are the methods which actually build the objects. They always have the class name and typically, they take a set of input parameters which describe how to build the object we want. Returning to our digital filter example, in LTPDA we have such a class 'miir'. To build an miir object (or make an instance of the class 'miir') you can do:
filt = miir()
------ miir/1 ------- b: [] histin: [] ntaps: 0 fs: [] infile: a: [] histout: [] iunits: [] ounits: [] hist: miir.hist procinfo: [] plotinfo: [] name: description: UUID: 70b4b3cd-2e65-4332-94cc-cffea1b0028c ---------------------
filt = miir(plist('type', 'lowpass', ... 'order', 1, ... 'fs', 10, ... 'fc', 1))
------ miir/1 ------- b: [1 -0.50952544949442879] histin: 0 ntaps: 2 fs: 10 infile: a: [0.2452372752527856 0.2452372752527856] histout: 0 iunits: [] ounits: [] hist: miir.hist procinfo: [] plotinfo: [] name: lowpass description: UUID: 6729d0ab-b29c-4c4c-9f90-0aca13b496fc ---------------------
There are various places where you can get help with using LTPDA. The most obvious is the User Manual. To access the LTPDA user manual, click on the menu "Help->Product Help" to launch MATLAB's documentation browser (or type 'doc' on the terminal). From there you can browse to the LTPDA Toolbox section.
To get help on individual methods, you use the built-in documentation. For our miir class, you do:
help miir
Parameters Description
The following table summarises the terms used in this section.
Term | Description |
---|---|
Class | A description of a real-word object or idea |
Property | Classes have properties which encapsulate features of the real-world object. |
Object | An example of a realisation (or instantiation) of a class. |
Method | A function that acts on instances of a class (objects). |
![]() |
Topic 1 - LTPDA Review. | Saving and loading objects | ![]() |
©LTP Team