Matlab -understanding filter( )

In summary, the filter() function in Matlab is used to apply digital filters to data in order to remove noise and unwanted components. It works by convolving the data with filter coefficients, which can be designed for different filter types such as low-pass, high-pass, band-pass, and band-stop. The function can be used for real-time filtering, but it is only suitable for linear time-invariant systems and may introduce artifacts if not carefully designed.
  • #1
cutesteph
63
0

Homework Statement


For my code for the communication system
if I have a channel implies response {.3,.6,-.3}

h=[.3 .6 -.3]

How do I get ych=filter(h,l,s) to work? I get an error when I run it. I get an error, Error: The press ion on the left of the equals sign is not a valid target for an assignment
 
Last edited:
Physics news on Phys.org
  • #2
Just off the top of my head, you have ych = filter(h, l, s), with the middle parameter the letter l (ell). In the link, the middle parameter is the number 1.
 
  • #3
Thanks.
 

1. What is the purpose of the filter() function in Matlab?

The filter() function in Matlab is used to apply a digital filter to a sequence of data. It allows for the removal of noise and unwanted components from the data, making it easier to analyze and interpret.

2. How does the filter() function work?

The filter() function works by taking in two main inputs: the data to be filtered and the filter coefficients. The filter coefficients determine the characteristics of the filter, such as its type (low-pass, high-pass, etc.) and cutoff frequencies. The function then convolves the data with the filter coefficients to produce the filtered output.

3. What types of filters can be applied using the filter() function?

The filter() function in Matlab can apply various types of filters, including low-pass, high-pass, band-pass, and band-stop filters. These filters can be designed using different techniques, such as Butterworth, Chebyshev, and elliptic filter designs.

4. Can the filter() function be used for real-time filtering?

Yes, the filter() function in Matlab can be used for real-time filtering. This means that the data can be filtered as it is being collected or processed, allowing for immediate analysis and visualization.

5. Are there any limitations to using the filter() function in Matlab?

One limitation of the filter() function is that it is only suitable for linear time-invariant (LTI) systems. This means that the filter coefficients must remain constant over time and the input data must be stationary. Additionally, the filter may introduce artifacts or distortions in the filtered output if the filter design is not carefully chosen.

Similar threads

  • Engineering and Comp Sci Homework Help
Replies
3
Views
805
  • Engineering and Comp Sci Homework Help
Replies
2
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
941
  • Engineering and Comp Sci Homework Help
Replies
1
Views
876
  • Engineering and Comp Sci Homework Help
Replies
1
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
11
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
746
  • Engineering and Comp Sci Homework Help
Replies
1
Views
2K
  • Mechanical Engineering
Replies
5
Views
1K
Replies
8
Views
804
Back
Top